[refactor,util][xs]: remove remaining code in util.js as not used anywhere (position and $.fn.serializeObject).
This commit is contained in:
34
src/util.js
34
src/util.js
@@ -1,36 +1,2 @@
|
|||||||
/*jshint multistr:true */
|
/*jshint multistr:true */
|
||||||
|
|
||||||
var util = function() {
|
|
||||||
$.fn.serializeObject = function() {
|
|
||||||
var o = {};
|
|
||||||
var a = this.serializeArray();
|
|
||||||
$.each(a, function() {
|
|
||||||
if (o[this.name]) {
|
|
||||||
if (!o[this.name].push) {
|
|
||||||
o[this.name] = [o[this.name]];
|
|
||||||
}
|
|
||||||
o[this.name].push(this.value || '');
|
|
||||||
} else {
|
|
||||||
o[this.name] = this.value || '';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return o;
|
|
||||||
};
|
|
||||||
|
|
||||||
function position( thing, elem, offset ) {
|
|
||||||
var position = $(elem.target).position();
|
|
||||||
if (offset) {
|
|
||||||
if (offset.top) position.top += offset.top;
|
|
||||||
if (offset.left) position.left += offset.left;
|
|
||||||
}
|
|
||||||
$('.' + thing + '-overlay').show().click(function(e) {
|
|
||||||
$(e.target).hide();
|
|
||||||
$('.' + thing).hide();
|
|
||||||
});
|
|
||||||
$('.' + thing).show().css({top: position.top + $(elem.target).height(), left: position.left});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
position: position
|
|
||||||
};
|
|
||||||
}();
|
|
||||||
|
|||||||
Reference in New Issue
Block a user