--- a/coffee/sidebar.coffee Sun Apr 03 18:51:54 2016 +0800
+++ b/coffee/sidebar.coffee Sun Apr 03 22:03:54 2016 +0800
"background: #{ @colors[show] || @colors['default'] };"
+ minified = not @model.get('sidebar/minified')
+ @model.set('sidebar/minified', minified)
+ @$el.parent().toggleClass('mini', minified)
$btn = $(event.currentTarget)
show = $btn.attr('data-show')
--- a/css/tram-im.css Sun Apr 03 18:51:54 2016 +0800
+++ b/css/tram-im.css Sun Apr 03 22:03:54 2016 +0800
+ transition: padding-left 0.1s ease-in-out;
+ transition: width 0.1s ease-in-out;
--- a/index.html Sun Apr 03 18:51:54 2016 +0800
+++ b/index.html Sun Apr 03 22:03:54 2016 +0800
<div class="has-sidebar uk-hidden" data-step="main">
- <div class="sidebar" data-app="sidebar">
+ <div class="sidebar" data-app="sidebar" rv-class-mini="model:sidebar/minified">
<ul class="uk-nav uk-nav-side uk-nav-offcanvas uk-text-nowrap">
+ <li class="uk-text-center">
+ <a rv-on-click="view.minify">
+ <i class="uk-icon-chevron-right" rv-if="model:sidebar/minified"></i>
+ <i class="uk-icon-chevron-left" rv-unless="model:sidebar/minified"></i>
+ <li class="uk-nav-divider"></li>
<li rv-class-uk-active="model:show | eq 'chat'">
<a data-show="chat" rv-on-click="view.show">
- <div class="status-pip" rv-style="'chat' | fn view.getPipColor"></div> Ready to chat
+ <div class="status-pip" rv-style="'chat' | fn view.getPipColor"></div>
+ <span class="label">Ready to chat</span>
<li rv-class-uk-active="model:show | eq 'online'">
<a data-show="online" rv-on-click="view.show">
- <div class="status-pip" rv-style="'online' | fn view.getPipColor"></div> Online
+ <div class="status-pip" rv-style="'online' | fn view.getPipColor"></div>
+ <span class="label">Online</span>
<li rv-class-uk-active="model:show | eq 'away'">
<a data-show="away" rv-on-click="view.show">
- <div class="status-pip" rv-style="'away' | fn view.getPipColor"></div> Away
+ <div class="status-pip" rv-style="'away' | fn view.getPipColor"></div>
+ <span class="label">Away</span>
<li rv-class-uk-active="model:show | eq 'xa'">
<a data-show="xa" rv-on-click="view.show">
- <div class="status-pip" rv-style="'xa' | fn view.getPipColor"></div> Gone
+ <div class="status-pip" rv-style="'xa' | fn view.getPipColor"></div>
+ <span class="label">Gone</span>
<li class="uk-nav-divider"></li>
- <li><a rv-on-click="view.disconnect"><i class="uk-icon-sign-out"></i> Log out</a></li>
+ <a rv-on-click="view.disconnect">
+ <i class="uk-icon-sign-out"></i>
+ <span class="label">Log out</span>
--- a/js/sidebar.js Sun Apr 03 18:51:54 2016 +0800
+++ b/js/sidebar.js Sun Apr 03 22:03:54 2016 +0800
this.disconnect = bind(this.disconnect, this);
this.show = bind(this.show, this);
+ this.minify = bind(this.minify, this);
this.getPipColor = bind(this.getPipColor, this);
return SidebarApp.__super__.constructor.apply(this, arguments);
return "background: " + (this.colors[show] || this.colors['default']) + ";";
+ SidebarApp.prototype.minify = function() {
+ minified = !this.model.get('sidebar/minified');
+ this.model.set('sidebar/minified', minified);
+ return this.$el.parent().toggleClass('mini', minified);
SidebarApp.prototype.show = function(event) {
$btn = $(event.currentTarget);
--- a/js/sidebar.js.map Sun Apr 03 18:51:54 2016 +0800
+++ b/js/sidebar.js.map Sun Apr 03 22:03:54 2016 +0800
- "mappings": ";AAAA;AAAA,MAAA;;;;EAAM,MAAM,CAAC,IAAI,CAAC;;;;;;;;;;yBAChB,MAAA,GAAQ,IAAI,CAAC,MAAM,CAAC;;yBAEpB,UAAA,GAAY,SAAA;aACV,IAAC,CAAA,MAAD,CAAA;IADU;;yBAGZ,WAAA,GAAa,SAAC,IAAD;aACX,cAAA,GAAc,CAAE,IAAC,CAAA,MAAO,CAAA,IAAA,CAAR,IAAiB,IAAC,CAAA,MAAO,CAAA,SAAA,CAA3B,CAAd,GAAqD;IAD1C;;yBAGb,IAAA,GAAM,SAAC,KAAD;AACJ,UAAA;MAAA,IAAA,GAAO,CAAA,CAAE,KAAK,CAAC,aAAR;MACP,IAAA,GAAO,IAAI,CAAC,IAAL,CAAU,WAAV;MACP,MAAA,GAAS,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