diff options
| author | Misko Hevery | 2011-09-08 13:56:29 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-10-11 11:01:45 -0700 | 
| commit | 4f78fd692c0ec51241476e6be9a4df06cd62fdd6 (patch) | |
| tree | 91f70bb89b9c095126fbc093f51cedbac5cb0c78 /src/jqLite.js | |
| parent | df6d2ba3266de405ad6c2f270f24569355706e76 (diff) | |
| download | angular.js-4f78fd692c0ec51241476e6be9a4df06cd62fdd6.tar.bz2 | |
feat(forms): new and improved forms
Diffstat (limited to 'src/jqLite.js')
| -rw-r--r-- | src/jqLite.js | 15 | 
1 files changed, 12 insertions, 3 deletions
| diff --git a/src/jqLite.js b/src/jqLite.js index 5f761f92..0052055c 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -100,6 +100,10 @@ function camelCase(name) {  /////////////////////////////////////////////  // jQuery mutation patch +// +//  In conjunction with bindJQuery intercepts all jQuery's DOM destruction apis and fires a +// $destroy event on all DOM nodes being removed. +//  /////////////////////////////////////////////  function JQLitePatchJQueryRemove(name, dispatchThis) { @@ -129,7 +133,9 @@ function JQLitePatchJQueryRemove(name, dispatchThis) {          } else {            fireEvent = !fireEvent;          } -        for(childIndex = 0, childLength = (children = element.children()).length; childIndex < childLength; childIndex++) { +        for(childIndex = 0, childLength = (children = element.children()).length;  +            childIndex < childLength;  +            childIndex++) {            list.push(jQuery(children[childIndex]));          }        } @@ -283,7 +289,10 @@ var JQLitePrototype = JQLite.prototype = {  // these functions return self on setter and  // value on get.  ////////////////////////////////////////// -var SPECIAL_ATTR = makeMap("multiple,selected,checked,disabled,readonly,required"); +var BOOLEAN_ATTR = {}; +forEach('multiple,selected,checked,disabled,readOnly,required'.split(','), function(value, key) { +  BOOLEAN_ATTR[lowercase(value)] = value; +});  forEach({    data: JQLiteData, @@ -331,7 +340,7 @@ forEach({    },    attr: function(element, name, value){ -    if (SPECIAL_ATTR[name]) { +    if (BOOLEAN_ATTR[name]) {        if (isDefined(value)) {          if (!!value) {            element[name] = true; | 
