These are chat archives for mydigitalself/thoughts2

11th
Jun 2015
Mike Bartlett
@mydigitalself
Jun 11 2015 15:11
updateVisibility: function() {
    var requiredVisiblity = this.getVisible();
    var visible = !this.hidden;
    if (requiredVisiblity === visible) return; // Nothing to do here     if (requiredVisiblity === visible) return; // Nothing to do here     if (requiredVisiblity === visible) return; // Nothing to do here
    if (visible) {
      // Hide
      this.$el.addClass('slide-away');

      this.ui.buttons.blur();
      if (this.hideTimeout) return;

      this.hideTimeout = setTimeout(function() {
        delete this.hideTimeout;
        this.hidden = true;
        this.$el.parent().hide();
      }.bind(this), 500);

    } else {
      // Show
      this.$el.parent().show();
      this.$el.removeClass('slide-away');
      this.hidden = false;
      if (this.hideTimeout) {
        clearTimeout(this.hideTimeout);
        delete this.hideTimeout;
      }
    }
  },