define(function(require, exports) {
var $html = '
';
var selector;
var divCity;
var CitySelector = function(options) {
var that = this;
that.showPopup = function(ele) {
var offset = ele.offset();
divCity.css({ left: offset.left + "px", top: (offset.top + ele.height()) + "px" });
divCity.addClass("open");
};
that.hidePopup = function() {
divCity.removeClass("open");
};
return this;
};
exports.init = function(eleSelector, args) {
$("body").append($html);
divCity = $("#citySelector");
args = $.extend({}, args);
selector = new CitySelector(args);
$(document).on("focus", eleSelector, function () {
selector.showPopup($(this));
}).on("blur", eleSelector, function () {
selector.hidePopup($(this));
});
};
});