(function(app) {
  'use strict';

  var dom = app.dom || require('../dom.js');
  var Button = app.Button || require('./button.js');

  var SidebarToggleButton = Button.inherits(function(props) {
    this.sidebarVisible = this.prop(true);
    this.toggler = props.toggler;
  });

  SidebarToggleButton.prototype.type = function() {
    return (this.sidebarVisible() ? 'collapse' : 'expand');
  };

  SidebarToggleButton.prototype.ontap = function() {
    var visible = !this.sidebarVisible();
    this.disabled(true);
    this.toggler(visible).then(function() {
      this.sidebarVisible(visible);
      this.disabled(false);
    }.bind(this)).catch(function() {
      this.disabled(false);
    }.bind(this));
  };

  SidebarToggleButton.prototype.onredraw = function() {
    this.redrawProp('type', function(type) {
      dom.data(this.element(), 'type', type);
    });
  };

  if (typeof module !== 'undefined' && module.exports) {
    module.exports = SidebarToggleButton;
  } else {
    app.SidebarToggleButton = SidebarToggleButton;
  }
})(this.app || (this.app = {}));

@@ -426,13 +426,14 @@
 ype.
-ontap
+toggle
  = f
@@ -494,32 +494,14 @@
     
-this.disabled(true);%0A   
+return
  thi
@@ -575,16 +575,92 @@
 ble);%0A  
+  %7D.bind(this));%0A  %7D;%0A%0A  SidebarToggleButton.prototype.ontap = function() %7B%0A
     this
@@ -665,36 +665,35 @@
 is.disabled(
-fals
+tru
 e);%0A    
 %7D.bind(this)
@@ -684,27 +684,26 @@
     
-%7D.bind(this)).catch
+this.toggle().then
 (fun

Modify method for toggling sidebar