This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 77 < label > {{item.title}}</ label >
88 < button class ="destroy " on-click ="destroyAction "> </ button >
99 </ div >
10- < input is ="td-input " id ="edit " class ="edit " value ="{{title}} " hidden? ="{{!editing}} " on-td-input-commit ="commitAction " on-td-input-cancel ="cancelAction ">
10+ < input is ="td-input " id ="edit " class ="edit " value ="{{item. title}} " hidden? ="{{!editing}} " on-td-input-commit ="commitAction " on-td-input-cancel ="cancelAction ">
1111 </ template >
1212 < script >
1313 ( function ( ) {
14- var ENTER_KEY = 13 ;
15- var ESC_KEY = 27 ;
1614 Polymer ( 'td-item' , {
1715 editing : false ,
1816 editAction : function ( ) {
1917 this . editing = true ;
20- // FIXME: Custom elements extended from <input> don't have
21- // <input> binding behavior.
22- // https://github.com/Polymer/polymer/issues/186
23- this . $ . edit . value = this . title = this . item . title ;
2418 // schedule focus for the end of microtask, when the input will be visible
25- Platform . flush ( ) ;
2619 this . asyncMethod ( function ( ) {
2720 this . $ . edit . focus ( ) ;
2821 } ) ;
2922 } ,
3023 commitAction : function ( ) {
31- // FIXME: Custom elements extended from <input> don't have
32- // <input> binding behavior.
33- // https://github.com/Polymer/polymer/issues/186
34- this . title = this . $ . edit . value ;
3524 if ( this . editing ) {
3625 this . editing = false ;
37- this . item . title = this . title . trim ( ) ;
26+ this . item . title = this . item . title . trim ( ) ;
3827 if ( this . item . title === '' ) {
3928 this . destroyAction ( ) ;
4029 }
41- this . fire ( 'td-item-changed' ) ;
30+ this . fire ( 'td-item-changed' ) ;
4231 }
4332 } ,
4433 cancelAction : function ( ) {
You can’t perform that action at this time.
0 commit comments