Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
Fixing scroll issue with global nanoscroller object
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesportwoodii committed Dec 23, 2014
1 parent e67804b commit 32a52e1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
14 changes: 9 additions & 5 deletions assets/dist/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12383,7 +12383,7 @@ Array.prototype.remove = function(from, to) {

// Bind behaviors
self.clickBehavior();
CiiMSDashboard.nanoscroller();
CiiMSDashboard.nanoscroller('Categories');
},

/**
Expand Down Expand Up @@ -12692,9 +12692,13 @@ Array.prototype.remove = function(from, to) {
* Triggers the nanoscroller
* @return nanoScroller
*/
nanoscroller : function() {
nanoscroller : function(element) {
// Froce nanoscroller to rebuild itself
var self = this;
if (typeof element == "undefined")
selfi = self;
else
selfi = window[element];

$(".paginated_results .nano").nanoScroller({ destroy: true });
$(".paginated_results .nano").nanoScroller({ iOSNativeScrolling: true });
Expand All @@ -12703,7 +12707,7 @@ Array.prototype.remove = function(from, to) {
$(".paginated_results .nano .nano-content").unbind("scroll");
$(".paginated_results .nano .nano-content").bind("scroll", function(e) {
if($(this).scrollTop() + $(this).innerHeight() >= this.scrollHeight - 1)
self.list(false, self.query, ++self.page);
selfi.list(false, selfi.query, ++selfi.page);
});
}
};;var Content = {
Expand Down Expand Up @@ -12785,7 +12789,7 @@ Array.prototype.remove = function(from, to) {

// Bind behaviors
self.clickBehavior();
CiiMSDashboard.nanoscroller();
CiiMSDashboard.nanoscroller('Content');
},

/**
Expand Down Expand Up @@ -15597,7 +15601,7 @@ if (!String.prototype.ordinalize)

// Bind behaviors
self.clickBehavior();
CiiMSDashboard.nanoscroller();
CiiMSDashboard.nanoscroller('Users');
},

/**
Expand Down
4 changes: 2 additions & 2 deletions assets/dist/fonts/font-awesome.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot?v=4.1.0');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
src: url('./fonts/fontawesome-webfont.eot?v=4.1.0');
src: url('./fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('./fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('./fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('./fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ var Categories = {

// Bind behaviors
self.clickBehavior();
CiiMSDashboard.nanoscroller();
CiiMSDashboard.nanoscroller('Categories');
},

/**
Expand Down
8 changes: 6 additions & 2 deletions assets/js/ciimsdashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ var CiiMSDashboard = {
* Triggers the nanoscroller
* @return nanoScroller
*/
nanoscroller : function() {
nanoscroller : function(element) {
// Froce nanoscroller to rebuild itself
var self = this;
if (typeof element == "undefined")
selfi = self;
else
selfi = window[element];

$(".paginated_results .nano").nanoScroller({ destroy: true });
$(".paginated_results .nano").nanoScroller({ iOSNativeScrolling: true });
Expand All @@ -100,7 +104,7 @@ var CiiMSDashboard = {
$(".paginated_results .nano .nano-content").unbind("scroll");
$(".paginated_results .nano .nano-content").bind("scroll", function(e) {
if($(this).scrollTop() + $(this).innerHeight() >= this.scrollHeight - 1)
self.list(false, self.query, ++self.page);
selfi.list(false, selfi.query, ++selfi.page);
});
}
};
2 changes: 1 addition & 1 deletion assets/js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var Content = {

// Bind behaviors
self.clickBehavior();
CiiMSDashboard.nanoscroller();
CiiMSDashboard.nanoscroller('Content');
},

/**
Expand Down
2 changes: 1 addition & 1 deletion assets/js/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var Users = {

// Bind behaviors
self.clickBehavior();
CiiMSDashboard.nanoscroller();
CiiMSDashboard.nanoscroller('Users');
},

/**
Expand Down

0 comments on commit 32a52e1

Please sign in to comment.