-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidget.js
29 lines (29 loc) · 1.03 KB
/
widget.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(["mu-jquery-widget-addressfield/widget"], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory(require("mu-jquery-widget-addressfield/widget"));
} else {
root["basic-example/widget"] = factory(root["mu-jquery-widget-addressfield/widget"]);
}
})(this, function (widget) {
return widget.extend(function ($element, ns) {
$element.data("mu-jquery-widget-addressfield", {
json: "https://rawgit.com/tableau-mkt/addressfield.json/v1.1.0/src/addressfield.json",
fields: {
country: "#country",
locality: "#locality-fields",
localityname: "#city",
administrativearea: "#state",
postalcode: "#zip"
}
});
}, {
"on/initialize": function ($event, initialized) {
var $element = this.$element;
initialized(function (names) {
$element.append("<p>initialized: " + names.join(", ") + "</p>");
});
}
});
});