All Downloads are FREE. Search and download functionalities are using the official Maven repository.

visualsearch.0.4.0.docs.backbone_extensions.html Maven / Gradle / Ivy

      backbone_extensions.js           

backbone_extensions.js

(function(){

  var $ = jQuery; // Handle namespaced jQuery

Makes the view enter a mode. Modes have both a 'mode' and a 'group', and are mutually exclusive with any other modes in the same group. Setting will update the view's modes hash, as well as set an HTML class of [mode]_[group] on the view's element. Convenient way to swap styles and behavior.

  Backbone.View.prototype.setMode = function(mode, group) {
    this.modes || (this.modes = {});
    if (this.modes[group] === mode) return;
    $(this.el).setMode(mode, group);
    this.modes[group] = mode;
  };

})();





© 2015 - 2025 Weber Informatics LLC | Privacy Policy