mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
refactored
This commit is contained in:
parent
fd2c227cf7
commit
5006aa500f
1 changed files with 4 additions and 13 deletions
|
|
@ -6,7 +6,7 @@ var Util, DOM, $;
|
|||
|
||||
/* setting head ie6 - ie8 */
|
||||
if(!document.head){
|
||||
document.head = document.getElementsByTagName("head")[0];
|
||||
document.head = $('head')[0];
|
||||
|
||||
/*
|
||||
{name: '', src: ' ',func: '', style: '', id: '', parent: '',
|
||||
|
|
@ -45,22 +45,13 @@ var Util, DOM, $;
|
|||
* @param pType
|
||||
* @param pListener
|
||||
*/
|
||||
DOM.addListener = function(pType, pListener){
|
||||
var lRet = this,
|
||||
lType = 'on' + pType,
|
||||
lFunc = document[lType];
|
||||
|
||||
document[lType] = function(){
|
||||
Util.exec(lFunc);
|
||||
pListener();
|
||||
};
|
||||
|
||||
return lRet;
|
||||
DOM.addListener = function(pType, pListener, pCapture, pElement){
|
||||
return $(pElement || window).bind(pType, null, pListener);
|
||||
};
|
||||
|
||||
if(document.removeEventListener){
|
||||
DOM.removeListener = function(pType, pListener, pCapture, pElement){
|
||||
$(pElement || window).unbind(pType, pListener);
|
||||
return $(pElement || window).unbind(pType, pListener);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue