| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of mdv; | 5 part of mdv; |
| 6 | 6 |
| 7 // This code is a port of Model-Driven-Views: | 7 // This code is a port of Model-Driven-Views: |
| 8 // https://github.com/polymer-project/mdv | 8 // https://github.com/polymer-project/mdv |
| 9 // The code mostly comes from src/template_element.js | 9 // The code mostly comes from src/template_element.js |
| 10 | 10 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 194 |
| 195 static Object resolveInputs(Map values) { | 195 static Object resolveInputs(Map values) { |
| 196 if (values.containsKey('if') && !_toBoolean(values['if'])) { | 196 if (values.containsKey('if') && !_toBoolean(values['if'])) { |
| 197 return null; | 197 return null; |
| 198 } | 198 } |
| 199 | 199 |
| 200 if (values.containsKey('repeat')) { | 200 if (values.containsKey('repeat')) { |
| 201 return values['repeat']; | 201 return values['repeat']; |
| 202 } | 202 } |
| 203 | 203 |
| 204 if (values.containsKey('bind')) { | 204 if (values.containsKey('bind') || values.containsKey('if')) { |
| 205 return [values['bind']]; | 205 return [values['bind']]; |
| 206 } | 206 } |
| 207 | 207 |
| 208 return null; | 208 return null; |
| 209 } | 209 } |
| 210 | 210 |
| 211 void valueChanged(value) { | 211 void valueChanged(value) { |
| 212 // TODO(jmesserly): should PathObserver do this for us? | 212 // TODO(jmesserly): should PathObserver do this for us? |
| 213 var oldValue = _lastValue; | 213 var oldValue = _lastValue; |
| 214 _lastValue = value; | 214 _lastValue = value; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 nodeExt._templateIterator = null; | 362 nodeExt._templateIterator = null; |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 | 365 |
| 366 _nodeOrCustom(node).unbindAll(); | 366 _nodeOrCustom(node).unbindAll(); |
| 367 for (var c = node.firstChild; c != null; c = c.nextNode) { | 367 for (var c = node.firstChild; c != null; c = c.nextNode) { |
| 368 _unbindAllRecursively(c); | 368 _unbindAllRecursively(c); |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 } | 371 } |
| OLD | NEW |