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

visualsearch.0.4.0.lib.js.utils.backbone_extensions.js Maven / Gradle / Ivy

There is a newer version: 0.10.3
Show newest version
(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 - 2024 Weber Informatics LLC | Privacy Policy