{I" class:ETI"ProcessedAsset;FI"logical_path;TI"$mercury/toolbar.button_group.js;FI" pathname;TI"”/home/edik/.rvm/gems/ruby-2.0.0-p247@very_simple_cms/bundler/gems/mercury-3e0245e33195/app/assets/javascripts/mercury/toolbar.button_group.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+½¡9RI" length;Ti*I" digest;TI"%3b040e51ee65cbb5c0953edddf193032;FI" source;TI"*(function() { this.Mercury.Toolbar.ButtonGroup = (function() { function ButtonGroup(name, options) { this.name = name; this.options = options != null ? options : {}; this.build(); this.bindEvents(); this.regions = this.options._regions; return this.element; } ButtonGroup.prototype.build = function() { this.element = jQuery('
', { "class": "mercury-button-group mercury-" + this.name + "-group" }); if (this.options._context || this.options._regions) { return this.element.addClass('disabled'); } }; ButtonGroup.prototype.bindEvents = function() { var _this = this; Mercury.on('region:update', function(event, options) { var context, element; context = Mercury.Toolbar.ButtonGroup.contexts[_this.name]; if (context) { if (options.region && jQuery.type(options.region.currentElement) === 'function') { element = options.region.currentElement(); if (element.length && context.call(_this, element, options.region.element)) { return _this.element.removeClass('disabled'); } else { return _this.element.addClass('disabled'); } } } }); Mercury.on('region:focused', function(event, options) { if (_this.regions && options.region && options.region.type()) { if (_this.regions.indexOf(options.region.type()) > -1) { if (!_this.options._context) { return _this.element.removeClass('disabled'); } } else { return _this.element.addClass('disabled'); } } }); return Mercury.on('region:blurred', function(event, options) { if (_this.options.regions) { return _this.element.addClass('disabled'); } }); }; return ButtonGroup; })(); this.Mercury.Toolbar.ButtonGroup.contexts = { table: function(node, region) { return !!node.closest('table', region).length; } }; }).call(this); ;TI"dependency_digest;TI"%5c2e3f1ea5dd23eb2b22d63316e6dab1;FI"required_paths;T[I"”/home/edik/.rvm/gems/ruby-2.0.0-p247@very_simple_cms/bundler/gems/mercury-3e0245e33195/app/assets/javascripts/mercury/toolbar.button_group.js.coffee;FI"dependency_paths;T[{I" path;TI"”/home/edik/.rvm/gems/ruby-2.0.0-p247@very_simple_cms/bundler/gems/mercury-3e0245e33195/app/assets/javascripts/mercury/toolbar.button_group.js.coffee;FI" mtime;TI"2013-09-18T16:51:09+04:00;TI" digest;TI"%c1fdc4ac99fd8f8dd8b6c72126cb6f28;FI" _version;TI"%2cf3622cbba861b85d33ffabfa420c13;F