[refactor,util][xs]: remove remaining code in util.js as not used anywhere (position and $.fn.serializeObject).

This commit is contained in:
Rufus Pollock 2012-04-26 21:54:10 +01:00
parent 07758bd3b5
commit c358a5bd43

View File

@ -1,36 +1,2 @@
/*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
};
}();