mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
24 lines
610 B
JavaScript
24 lines
610 B
JavaScript
(function(window, document, framework) {
|
|
|
|
framework.get = function(id) {
|
|
return document.getElementById(id);
|
|
};
|
|
|
|
framework.getByClass = function(classname) {
|
|
return document.getElementByClassName(classname);
|
|
};
|
|
|
|
framework.getByTag = function(tagName) {
|
|
return document.getElementsByTagName(tagName);
|
|
};
|
|
|
|
framework.trigger = function(type, data) {
|
|
window.dispatchEvent( new CustomEvent(type, data) );
|
|
};
|
|
|
|
framework.on = function(type, callback, element) {
|
|
var e = element || window;
|
|
e.addEventListener(type, callback);
|
|
};
|
|
|
|
})(this, document, this.FM = this.FM || {}); |