sandbox/tmp/cache/assets/D34/280/sprockets%2F0fcf69c7e8fd9961e1158d70583e8f95 in iugu-ux-0.9.5 vs sandbox/tmp/cache/assets/D34/280/sprockets%2F0fcf69c7e8fd9961e1158d70583e8f95 in iugu-ux-0.9.8

- old
+ new

@@ -1,17 +1,18 @@ -o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1358772536.984206;: @value"{I" -class:EFI"ProcessedAsset;FI"logical_path;FI"9iugu-ux/components/usecode/iugu-ui-responsive-box.js;FI" pathname;FI"/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-responsive-box.js.coffee;FI"content_type;FI"application/javascript;FI" -mtime;FI"2013-01-12T18:03:34-02:00;FI" length;FiI" digest;F"%1d218c452de05a9c62e920764397003fI" source;FI"(function() { - var __hasProp = {}.hasOwnProperty, +o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1372772480.55025: @value"7{I" +class:EFI"ProcessedAsset;FI"logical_path;F"9iugu-ux/components/usecode/iugu-ui-responsive-box.jsI" pathname;F"/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-responsive-box.js.coffeeI"content_type;FI"application/javascript;FI" +mtime;FI"2013-06-29T15:36:00-03:00;FI" length;FixI" digest;F"%b1d817f5edbacbff596bf22aa1241f32I" source;FI"x(function() { + var _ref, + __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; IuguUI.ResponsiveBox = (function(_super) { - __extends(ResponsiveBox, _super); function ResponsiveBox() { - return ResponsiveBox.__super__.constructor.apply(this, arguments); + _ref = ResponsiveBox.__super__.constructor.apply(this, arguments); + return _ref; } ResponsiveBox.prototype.layout = "iugu-ui-responsive-box"; ResponsiveBox.prototype.defaults = { @@ -47,39 +48,98 @@ ResponsiveBox.prototype.getTitle = function() { return this.$('.responsive-title').html(); }; - ResponsiveBox.prototype.reallyToggleSidebar = function() { - var preventContainer, uibox, uisidebar; + ResponsiveBox.prototype.disableFeedback = function() { + var preventContainer, uibox; + uibox = this.$('.ui-responsive-box'); - uisidebar = uibox.children('.sidebar'); - if (uisidebar.css('z-index') !== '1000') { - return; - } preventContainer = $(document.createElement('div')); preventContainer.css('position', 'absolute'); preventContainer.css('width', '100%'); preventContainer.css('height', '100%'); preventContainer.css('left', '0px'); preventContainer.css('top', '0px'); preventContainer.css('backgroundColor', 'transparent'); preventContainer.css('z-index', '5000'); uibox.append(preventContainer); - uibox.toggleClass('open'); return setTimeout(function() { return preventContainer.remove(); }, 500); }; + ResponsiveBox.prototype.hasMovableSidebar = function() { + var uibox, uisidebar; + + uibox = this.$('.ui-responsive-box'); + uisidebar = uibox.children('.sidebar'); + if (uisidebar.css('z-index') !== '1000') { + return false; + } + return true; + }; + + ResponsiveBox.prototype.configureDisplayForSidebar = function(type) { + var uibox; + + uibox = this.$('.ui-responsive-box'); + if (!uibox) { + return; + } + switch (type) { + case "open": + if (!uibox.hasClass('open')) { + return uibox.addClass('open'); + } + break; + case "close": + if (uibox.hasClass('open')) { + return uibox.removeClass('open'); + } + break; + default: + return uibox.toggleClass('open'); + } + }; + ResponsiveBox.prototype.toggleSidebar = function(evt) { - evt.preventDefault(); - return this.reallyToggleSidebar(); + if (evt) { + evt.preventDefault(); + } + if (!this.hasMovableSidebar()) { + return; + } + this.disableFeedback(); + return this.configureDisplayForSidebar("toggle"); }; + ResponsiveBox.prototype.openSidebar = function(evt) { + if (evt) { + evt.preventDefault(); + } + if (!this.hasMovableSidebar()) { + return; + } + this.disableFeedback(); + return this.configureDisplayForSidebar("open"); + }; + + ResponsiveBox.prototype.closeSidebar = function(evt) { + if (evt) { + evt.preventDefault(); + } + if (!this.hasMovableSidebar()) { + return; + } + this.disableFeedback(); + return this.configureDisplayForSidebar("close"); + }; + ResponsiveBox.prototype.render = function() { var small_navigation, that; + ResponsiveBox.__super__.render.apply(this, arguments); $(document.body).addClass('ui-box-background'); this.sidebar_wrapper = $(document.createElement('div')); this.content_wrapper = $(document.createElement('div')); this.sidebar_wrapper.addClass("sidebar"); @@ -105,7 +165,7 @@ })(IuguUI.Base); this.IuguUI.ResponsiveBox = IuguUI.ResponsiveBox; }).call(this); -;TI"dependency_digest;F"%8b45a961de82798b160a99062a975bc7I"required_paths;F[I"/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-responsive-box.js.coffee;FI"dependency_paths;F[{I" path;FI"/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-responsive-box.js.coffee;FI" -mtime;FI"2013-01-12T18:03:34-02:00;FI" digest;F"%a1e944b25ca8a2e3a4479f83719d5255I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862 +;TI"dependency_digest;F"%c60bc9657b4e9bca82d463ca1303dc0dI"required_paths;F["/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-responsive-box.js.coffeeI"dependency_paths;F[{I" path;F"/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-responsive-box.js.coffeeI" +mtime;FI"2013-06-29T15:36:00-03:00;FI" digest;F"%c182d725eb690959ef7376afd2d31575I" _version;F"%6776f581a4329e299531e1d52aa59832 \ No newline at end of file