#26 rename spc into utility and remove unused polyfills and utility funcs
This commit is contained in:
parent
82056ab5a3
commit
cd606c5aba
2 changed files with 30 additions and 259 deletions
30
js/base/utility.js
Executable file
30
js/base/utility.js
Executable file
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* @file utility funcs and polyfills
|
||||
*
|
||||
*/
|
||||
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
|
||||
// object literal with funcs for jquery plug-ins
|
||||
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
|
||||
var utility = {};
|
||||
|
||||
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
|
||||
// js trim func for ie
|
||||
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
|
||||
if(typeof String.prototype.trim !== 'function') {
|
||||
String.prototype.trim = function() {
|
||||
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* custom event handler ‘show’/’hide’ events for using .on()
|
||||
*/
|
||||
(function ($) {
|
||||
$.each(['show', 'hide'], function (i, e) {
|
||||
var el = $.fn[e];
|
||||
$.fn[e] = function () {
|
||||
this.trigger(e);
|
||||
return el.apply(this, arguments);
|
||||
};
|
||||
});
|
||||
})(jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue