Last active
October 5, 2016 23:39
Revisions
-
englishextra revised this gist
Oct 5, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,8 @@ * LoadingSpinner.show(); * LoadingSpinner.hide(cb,n); */ var LoadingSpinner = function () { "use strict"; var h = BALA.one("html") || "", cls = "loading-spinner", a = BALA.one("." + cls) || "", @@ -23,7 +22,8 @@ var LoadingSpinner = function (cb, n) { show : function () { return h[cL].contains(cls) || h[cL].add(cls); }, hide : function (cb, n) { n = n || 500; var s = function () { setAutoClearedTimeout(function () { h[cL].remove(cls); @@ -34,4 +34,4 @@ var LoadingSpinner = function (cb, n) { } }; } (); -
englishextra revised this gist
Oct 5, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ * @param {Object} [cb] callback function * @param {Int} [n] any positive whole number, default: 500 * LoadingSpinner.show(); * LoadingSpinner.hide(cb,n); */ var LoadingSpinner = function (cb, n) { "use strict"; -
englishextra revised this gist
Oct 5, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ /*! * loading spinner * dependent on setAutoClearedTimeout * gist.github.com/englishextra/24ef040fbda405f7468da70e4f3b69e7 * @param {Object} [cb] callback function * @param {Int} [n] any positive whole number, default: 500 * LoadingSpinner.show(); -
englishextra created this gist
Oct 5, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ /*! * loading spinner * dependent on setAutoClearedTimeout * @param {Object} [cb] callback function * @param {Int} [n] any positive whole number, default: 500 * LoadingSpinner.show(); * LoadingSpinner.hide(500); */ var LoadingSpinner = function (cb, n) { "use strict"; n = n || 500; var h = BALA.one("html") || "", cls = "loading-spinner", a = BALA.one("." + cls) || "", cL = "classList"; if (!a) { a = crel("div"); a[cL].add(cls); appendFragment(a, h); }; return { show : function () { return h[cL].contains(cls) || h[cL].add(cls); }, hide : function (n) { var s = function () { setAutoClearedTimeout(function () { h[cL].remove(cls); cb && "function" === typeof cb && cb(); }, n); }; return s(); } }; } ();