Skip to content

Commit

Permalink
Removing 1.2 compat injectX methods Delegator.Ajax
Browse files Browse the repository at this point in the history
injectTop, injectBottom, injectBefore, injectAfter are 1.2 compat deprecated methods, so it's important to replace them.
I'm anal with the text case, that's why the toLowerCase at line 68.
  • Loading branch information
rolfnl authored and anutron committed Jan 31, 2014
1 parent ab84c94 commit b468060
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Delegators/Delegator.Ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ name: Delegator.Ajax
switch(action){
case 'replace':
var container = target.getParent();
elements.reverse().injectAfter(target);
elements.reverse().inject(target , 'after');
api.fireEvent('destroyDom', target);
target.destroy();
api.fireEvent('ammendDom', [container, elements]);
Expand All @@ -69,8 +69,9 @@ name: Delegator.Ajax
break;
default:
//injectTop, injectBottom, injectBefore, injectAfter
if (action == "injectTop" || action == "injectAfter") elements.reverse();
elements[action](target);
var where = action.replace('inject', '').toLowerCase();
if (where == 'top' || where == 'after') elements.reverse();
elements.inject(target, where);
api.fireEvent('ammendDom', [target, elements]);
}
}
Expand Down

0 comments on commit b468060

Please sign in to comment.