#26 rename spc into utility and remove unused polyfills and utility funcs

This commit is contained in:
Jana Deutschländer 2019-04-11 16:46:19 +02:00
commit cd606c5aba
2 changed files with 30 additions and 259 deletions

30
js/base/utility.js Executable file
View 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);