Make use of the t5/core/dom#scanner function
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/1b851058 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/1b851058 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/1b851058 Branch: refs/heads/master Commit: 1b851058e4d71c2349f64624da89fe9b02ba48a5 Parents: 98ad28a Author: Howard M. Lewis Ship <[email protected]> Authored: Fri May 9 11:40:46 2014 -0700 Committer: Howard M. Lewis Ship <[email protected]> Committed: Fri May 9 11:40:46 2014 -0700 ---------------------------------------------------------------------- .../META-INF/modules/t5/core/datefield.coffee | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1b851058/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee index aca4653..6d57b17 100644 --- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee +++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee @@ -147,20 +147,13 @@ define ["./dom", "./events", "./messages", "./ajax", "underscore", "./datepicker @hidePopup() - scan = (root) -> - for container in root.find "[data-component-type='core/DateField']" - # Hide it from later scans - container.attr "data-component-type", null - - new Controller(container) - # Initialization: - scan dom.body - - # And scan any newly added content: + dom.scanner "[data-component-type='core/DateField']", (container) -> + # Hide it from later scans + container.attr "data-component-type", null - dom.onDocument events.zone.didUpdate, -> scan this + new Controller(container) # Exports nothing. return null
