Skip to content

Commit

Permalink
feat: support reflowing fa-grid-layout and fa-scrollview when fa-inde…
Browse files Browse the repository at this point in the history
…x changes
  • Loading branch information
zackbrown committed Jul 29, 2014
1 parent 4c62288 commit 3a7d6ee
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions dist/famous-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,14 +636,15 @@ angular.module('famous.angular')
* from the sequence
* @returns {void}
*/
sequenceWith: function(scope, addMethod, removeMethod) {
sequenceWith: function(scope, addMethod, removeMethod, updateMethod) {
scope.$on('registerChild', function(evt, isolate) {
if (evt.targetScope.$id !== scope.$id) {
addMethod(isolate);
evt.stopPropagation();

// Attach the remove method to the isolate, so it can be invoked without scope, if it is provided
if(removeMethod) isolate.removeMethod = removeMethod;
if(updateMethod) isolate.updateMethod = updateMethod;
}
});
}
Expand Down Expand Up @@ -1870,7 +1871,8 @@ angular.module('famous.angular')
return _ch;
}(_children);
updateGridLayout();
}
},
updateGridLayout
);

},
Expand Down Expand Up @@ -2213,6 +2215,7 @@ angular.module('famous.angular')
return scope.$eval(attrs.faIndex);
}, function () {
isolate.index = scope.$eval(attrs.faIndex);
if(isolate.updateMethod) isolate.updateMethod();
});
}
};
Expand Down Expand Up @@ -3467,7 +3470,8 @@ angular.module('famous.angular')
return _ch;
}(_children);
updateScrollview();
}
},
updateScrollview
);

},
Expand Down
2 changes: 1 addition & 1 deletion dist/famous-angular.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/scripts/directives/fa-grid-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ angular.module('famous.angular')
return _ch;
}(_children);
updateGridLayout();
}
},
updateGridLayout
);

},
Expand Down
1 change: 1 addition & 0 deletions src/scripts/directives/fa-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ angular.module('famous.angular')
return scope.$eval(attrs.faIndex);
}, function () {
isolate.index = scope.$eval(attrs.faIndex);
if(isolate.updateMethod) isolate.updateMethod();
});
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/directives/fa-scrollview.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ angular.module('famous.angular')
return _ch;
}(_children);
updateScrollview();
}
},
updateScrollview
);

},
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/services/famousDecorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,15 @@ angular.module('famous.angular')
* from the sequence
* @returns {void}
*/
sequenceWith: function(scope, addMethod, removeMethod) {
sequenceWith: function(scope, addMethod, removeMethod, updateMethod) {
scope.$on('registerChild', function(evt, isolate) {
if (evt.targetScope.$id !== scope.$id) {
addMethod(isolate);
evt.stopPropagation();

// Attach the remove method to the isolate, so it can be invoked without scope, if it is provided
if(removeMethod) isolate.removeMethod = removeMethod;
if(updateMethod) isolate.updateMethod = updateMethod;
}
});
}
Expand Down

0 comments on commit 3a7d6ee

Please sign in to comment.