Skip to content

Commit

Permalink
Fixed issue #11. Updated code structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
mazong1123 committed Jul 30, 2016
1 parent d1ba6ab commit 2bbd942
Show file tree
Hide file tree
Showing 29 changed files with 143 additions and 83 deletions.
2 changes: 1 addition & 1 deletion dist/css/ratchetPro-theme-android.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* =============================================================
* RatchetPro v1.0.0 (https://github.com/mazong1123/ratchet-pro)
* Copyright 2015 mazong1123
* Copyright 2016 mazong1123
* Licensed under MIT (https://github.com/mazong1123/ratchet-pro/blob/master/LICENSE)
*
* v1.0.0 designed by @mazong1123.
Expand Down
2 changes: 1 addition & 1 deletion dist/css/ratchetPro-theme-android.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/ratchetPro-theme-ios.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* =============================================================
* RatchetPro v1.0.0 (https://github.com/mazong1123/ratchet-pro)
* Copyright 2015 mazong1123
* Copyright 2016 mazong1123
* Licensed under MIT (https://github.com/mazong1123/ratchet-pro/blob/master/LICENSE)
*
* v1.0.0 designed by @mazong1123.
Expand Down
2 changes: 1 addition & 1 deletion dist/css/ratchetPro-theme-ios.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/ratchetPro.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* =============================================================
* RatchetPro v1.0.0 (https://github.com/mazong1123/ratchet-pro)
* Copyright 2015 mazong1123
* Copyright 2016 mazong1123
* Licensed under MIT (https://github.com/mazong1123/ratchet-pro/blob/master/LICENSE)
*
* v1.0.0 designed by @mazong1123.
Expand Down
2 changes: 1 addition & 1 deletion dist/css/ratchetPro.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 25 additions & 10 deletions dist/js/ratchetPro.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* =============================================================
* RatchetPro v1.0.0 (https://github.com/mazong1123/ratchet-pro)
* Copyright 2015 mazong1123
* Copyright 2016 mazong1123
* Licensed under MIT (https://github.com/mazong1123/ratchet-pro/blob/master/LICENSE)
*
* v1.0.0 designed by @mazong1123.
Expand Down Expand Up @@ -1654,26 +1654,30 @@
init: function () {
var self = this;

self.isRatchetPageChangingReady = false;

self.entryCallback = undefined;

self.components = [];

self.domContentLoadedCallback = function () {
self.populateComponents();
if (self.isRatchetPageChangingReady) {
// Ratchet page changing system is ready. All page changing will go
// through pageContentReadyCallback routing.
// We do not need to listen to the DOMContentLoaded event now.
document.removeEventListener('DOMContentLoaded', self.domContentLoadedCallback);

// Dom is ready, call entryCallback().
if (typeof self.entryCallback === 'function') {
self.entryCallback();
return;
}

self.processAfterPageInitialized();
};

self.pageContentReadyCallback = function () {
self.populateComponents();
self.processAfterPageInitialized();

// Page changing end, page content is ready, call entryCallback();
if (typeof self.entryCallback === 'function') {
self.entryCallback();
}
// Enter into this method means the Ratchet page changing system is ready.
self.isRatchetPageChangingReady = true;
};
},

Expand Down Expand Up @@ -1794,6 +1798,17 @@
}

window.RATCHET.Class.Pusher.push(options);
},

processAfterPageInitialized: function () {
var self = this;

self.populateComponents();

// Dom is ready, call entryCallback().
if (typeof self.entryCallback === 'function') {
self.entryCallback();
}
}
});

Expand Down
4 changes: 2 additions & 2 deletions dist/js/ratchetPro.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/css/docs.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* =============================================================
* RatchetPro v1.0.0 (https://github.com/mazong1123/ratchet-pro)
* Copyright 2015 mazong1123
* Copyright 2016 mazong1123
* Licensed under MIT (https://github.com/mazong1123/ratchet-pro/blob/master/LICENSE)
*
* v1.0.0 designed by @mazong1123.
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/css/docs.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/assets/js/docs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/dist/css/ratchetPro-theme-android.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* =============================================================
* RatchetPro v1.0.0 (https://github.com/mazong1123/ratchet-pro)
* Copyright 2015 mazong1123
* Copyright 2016 mazong1123
* Licensed under MIT (https://github.com/mazong1123/ratchet-pro/blob/master/LICENSE)
*
* v1.0.0 designed by @mazong1123.
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/css/ratchetPro-theme-android.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/dist/css/ratchetPro-theme-ios.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* =============================================================
* RatchetPro v1.0.0 (https://github.com/mazong1123/ratchet-pro)
* Copyright 2015 mazong1123
* Copyright 2016 mazong1123
* Licensed under MIT (https://github.com/mazong1123/ratchet-pro/blob/master/LICENSE)
*
* v1.0.0 designed by @mazong1123.
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/css/ratchetPro-theme-ios.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/dist/css/ratchetPro.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* =============================================================
* RatchetPro v1.0.0 (https://github.com/mazong1123/ratchet-pro)
* Copyright 2015 mazong1123
* Copyright 2016 mazong1123
* Licensed under MIT (https://github.com/mazong1123/ratchet-pro/blob/master/LICENSE)
*
* v1.0.0 designed by @mazong1123.
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/css/ratchetPro.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2bbd942

Please sign in to comment.