diff options
author | suelockwood <deathbearbrown@gmail.com> | 2013-08-07 12:15:01 -0400 |
---|---|---|
committer | Garren Smith <garren.smith@gmail.com> | 2013-08-08 15:21:27 +0200 |
commit | a9c390e43959e7dd7b5303eae8ab2f65f8a299d7 (patch) | |
tree | e4a502ed52d511342c6215b61404d04f8054f837 | |
parent | 65451cd76c08c1add029bcb5a476f7d9f8fbbc4f (diff) | |
download | couchdb-a9c390e43959e7dd7b5303eae8ab2f65f8a299d7.tar.gz |
Fauxton
Resize animations
Missing semi colon
Fixed the naming convention so it makes more sense to what it does.
-rw-r--r-- | src/fauxton/app/api.js | 2 | ||||
-rw-r--r-- | src/fauxton/app/modules/fauxton/base.js | 12 | ||||
-rw-r--r-- | src/fauxton/app/resizeColumns.js (renamed from src/fauxton/app/resizeAnimation.js) | 10 |
3 files changed, 13 insertions, 11 deletions
diff --git a/src/fauxton/app/api.js b/src/fauxton/app/api.js index b8e144939..57bbff472 100644 --- a/src/fauxton/app/api.js +++ b/src/fauxton/app/api.js @@ -288,7 +288,7 @@ function(app, Fauxton) { if (!$('.spinner').length) { $('<div class="spinner"></div>') - .appendTo('#app-container') + .appendTo('#app-container'); } var routeObjectSpinner = new Spinner(opts).spin(); diff --git a/src/fauxton/app/modules/fauxton/base.js b/src/fauxton/app/modules/fauxton/base.js index 4b4690ff1..2b82d4939 100644 --- a/src/fauxton/app/modules/fauxton/base.js +++ b/src/fauxton/app/modules/fauxton/base.js @@ -14,15 +14,15 @@ define([ "app", // Libs "backbone", - "resizeAnimation" + "resizeColumns" ], -function(app, Backbone, ResizeAnimation) { +function(app, Backbone, resizeColumns) { //resizeAnimation - app.ResizeAnimation = new ResizeAnimation({ + app.resizeColumns = new resizeColumns({ selectorElements: '#dashboard-content' }); @@ -121,7 +121,7 @@ function(app, Backbone, ResizeAnimation) { function toggleMenu(){ $selectorList.toggleClass('closeMenu'); menuOpen = $selectorList.hasClass('closeMenu'); - app.ResizeAnimation.onResizeHandler(); + app.resizeColumns.onResizeHandler(); } $('#primary-navbar').on("click", ".nav a", function(){ @@ -129,13 +129,13 @@ function(app, Backbone, ResizeAnimation) { setTimeout( function(){ $selectorList.addClass('closeMenu'); - app.ResizeAnimation.onResizeHandler(); + app.resizeColumns.onResizeHandler(); },3000); } }); - app.ResizeAnimation.initialize(); + app.resizeColumns.initialize(); }, beforeRender: function () { diff --git a/src/fauxton/app/resizeAnimation.js b/src/fauxton/app/resizeColumns.js index 5465a7e11..d8bbacd82 100644 --- a/src/fauxton/app/resizeAnimation.js +++ b/src/fauxton/app/resizeColumns.js @@ -18,9 +18,10 @@ // "purely functional" helper system. define([ + "mixins" ], -function() { +function(mixins) { var Resize = function(options){ this.options = options; @@ -37,11 +38,12 @@ function() { return (this.getPrimaryNavWidth() + sidebarWidth); }, initialize: function(){ - $(window).off('resize'); + // $(window).off('resize'); var that = this; //add throttler :) this.lazyLayout = _.debounce(that.onResizeHandler, 300).bind(this); - $(window).on('resize', this.lazyLayout); + mixins.addWindowResize(this.lazyLayout,"animation"); + mixins.initWindowResize(); this.onResizeHandler(); }, updateOptions:function(options){ @@ -49,7 +51,7 @@ function() { this.options = options; }, turnOff:function(){ - $(window).off('resize'); + mixins.removeWindowResize("animation"); }, onResizeHandler: function (){ //if there is an override, do that instead |