Commit 2b995142 authored by Sindre Sorhus's avatar Sindre Sorhus

Convert from .select() to .focus()

#203
parent dbe7faa2
......@@ -28,7 +28,7 @@
},
'dblclick .view': function() {
this.view.$().addClass('editing');
this.view.$('.edit').select();
this.view.$('.edit').focus();
},
'click .destroy': function() {
this.destroy();
......
......@@ -9,7 +9,6 @@ todomvc.directive('todoFocus', function( $timeout ) {
if ( newval ) {
$timeout(function() {
elem[0].focus();
elem[0].select();
}, 0, false);
}
});
......
......@@ -9,7 +9,6 @@ todomvc.directive('todoFocus', function( $timeout ) {
if ( newval ) {
$timeout(function() {
elem[0].focus();
elem[0].select();
}, 0, false);
}
});
......
......@@ -114,7 +114,7 @@ fa(W)||f(Error("Invalid component class "+W));fa(V)||f(Error("Invalid renderer c
Md.prototype.remove=function(a){Ka(this.V,function(b){return a.o()===b.o()});Nd(this)};function Nd(a,b){(b===i||b)&&Pd(a);a.dispatchEvent(new Qd(a))}Md.prototype.getAll=p("V");function Pd(a){if(a.K){var b=[];D(a.V,function(a){b.push({completed:a.ia,title:a.vb,id:a.o()})});a.K.set("todos-closure",b)}}function Qd(a){K.call(this,"change",a)}B(Qd,K);G&&J(8);"ScriptEngine"in v&&"JScript"==v.ScriptEngine()&&(v.ScriptEngineMajorVersion(),v.ScriptEngineMinorVersion(),v.ScriptEngineBuildVersion());function Rd(a){return"object"===typeof a&&a&&0===a.oc?a.content:(""+a).replace(Sd,Td)}var Ud={"\x00":"&#0;",'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;","\t":"&#9;","\n":"&#10;","\x0B":"&#11;","\u000c":"&#12;","\r":"&#13;"," ":"&#32;","-":"&#45;","/":"&#47;","=":"&#61;","`":"&#96;","\u0085":"&#133;","\u00a0":"&#160;","\u2028":"&#8232;","\u2029":"&#8233;"};function Td(a){return Ud[a]}var Sd=/[\x00\x22\x26\x27\x3c\x3e]/g;function Vd(a){return"<strong>"+Rd(a.wb)+"</strong> "+(1==a.wb?"item":"items")+" left"};function Wd(){}B(Wd,V);y(Wd);Wd.prototype.j=function(a){var b='<button id="clear-completed">'+("Clear completed ("+Rd(a.C)+")")+"</button>",b=ac(b);vd(a,b);return b};Wd.prototype.L=s(m);Wd.prototype.T=function(a,b){a.innerHTML="Clear completed ("+Rd(b)+")"};Wd.prototype.r=function(a,b,c){(a=a.a())&&zd(a,b,c)};function Xd(){}B(Xd,V);y(Xd);Xd.prototype.j=function(a){var b='<span id="todo-count">'+Vd({wb:a.C})+"</span>",b=ac(b);vd(a,b);return b};Xd.prototype.L=s(m);Xd.prototype.T=function(a,b){a.innerHTML=Vd({wb:b})};Xd.prototype.r=function(a,b,c){(a=a.a())&&zd(a,b,c)};function Yd(){}B(Yd,V);y(Yd);Yd.prototype.j=function(a){var b;b='<li><div class="view"><input class="toggle" type="checkbox" '+(a.f&16?"checked":"")+"><label>"+Rd(a.C)+'</label><button class="destroy"></button></div><input class="edit" value="Rule the web"></li>';b=ac(b);vd(a,b);this.r(a,a.f,j);return b};Yd.prototype.r=function(a,b,c){var d=a.a();if(d){switch(b){case 16:this.Z(a,"done",c);(d?(d?d.childNodes[0]:k).childNodes[0]:k).checked=c;break;case 8:this.Z(a,"editing",c)}zd(d,b,c)}};
Yd.prototype.k=function(a){return a.a()?a.a().childNodes[1]:k};Yd.prototype.w=function(a){return a?(a?a.childNodes[0]:k).childNodes[1]:k};function Y(a){W.call(this,"",Yd.N(),a);Id(this,16,j);Id(this,8,j);this.ua&=-17;this.ua&=-9;this.Ea(j)}B(Y,W);Y.prototype.v=function(){Y.d.v.call(this);R(Vc(this),this.a(),"click",function(a){a.preventDefault()});R(Vc(this),this.a(),"dblclick",function(){this.Ia(j)});var a=this.a()?this.a().childNodes[1]:k;R(Vc(this),a,"keyup",function(a){13===a.H.keyCode&&this.Fa(m)})};
Y.prototype.xa=function(a){Y.d.xa.call(this,a);this.isEnabled()&&(a.target===(this.a()?(this.a()?this.a().childNodes[0]:k).childNodes[0]:k)?(Gd(this,!(this.f&16)),this.dispatchEvent("edit")):a.target===(this.a()?(this.a()?this.a().childNodes[0]:k).childNodes[2]:k)&&this.dispatchEvent("destroy"))};Y.prototype.Fa=function(a){Y.d.Fa.call(this,a);!a&&this.f&8&&(a=sa((this.a()?this.a().childNodes[1]:k).value),""===a?this.dispatchEvent("destroy"):(this.T(a),this.Ia(m),this.dispatchEvent("edit")))};
Y.prototype.Ia=function(a){Y.d.Ia.call(this,a);a&&(a=this.a()?this.a().childNodes[1]:k,a.value=this.C,a.select())};function Zd(){}B(Zd,V);y(Zd);Zd.prototype.j=function(a){return a.Pa().j("div",this.z())};Zd.prototype.Y=function(a,b){b.id&&a.Ga(b.id);if("HR"==b.tagName){var c=b,b=this.j(a);c.parentNode&&c.parentNode.insertBefore(b,c);cc(c)}else Rb(b,this.z());return b};Zd.prototype.T=function(){};Zd.prototype.z=s("goog-menuseparator");function $d(a,b){W.call(this,k,a||Zd.N(),b);Id(this,1,m);Id(this,2,m);Id(this,4,m);Id(this,32,m);this.f=1}B($d,W);$d.prototype.v=function(){$d.d.v.call(this);td(this.a(),"separator")};Bd("goog-menuseparator",function(){return new $d});function ae(){}y(ae);function be(a,b){a&&(a.tabIndex=b?0:-1)}u=ae.prototype;u.j=function(a){return a.Pa().j("div",this.lb(a).join(" "))};u.w=function(a){return a};u.L=function(a){return"DIV"==a.tagName};u.Y=function(a,b){b.id&&a.Ga(b.id);var c=this.z(),d=m,e=Qb(b);e&&D(e,function(b){b==c?d=j:b&&(b==c+"-disabled"?a.J(m):b==c+"-horizontal"?ce(a,de):b==c+"-vertical"&&ce(a,ee))},this);d||Rb(b,c);fe(a,this.w(b));return b};
Y.prototype.Ia=function(a){Y.d.Ia.call(this,a);a&&(a=this.a()?this.a().childNodes[1]:k,a.value=this.C,a.focus())};function Zd(){}B(Zd,V);y(Zd);Zd.prototype.j=function(a){return a.Pa().j("div",this.z())};Zd.prototype.Y=function(a,b){b.id&&a.Ga(b.id);if("HR"==b.tagName){var c=b,b=this.j(a);c.parentNode&&c.parentNode.insertBefore(b,c);cc(c)}else Rb(b,this.z());return b};Zd.prototype.T=function(){};Zd.prototype.z=s("goog-menuseparator");function $d(a,b){W.call(this,k,a||Zd.N(),b);Id(this,1,m);Id(this,2,m);Id(this,4,m);Id(this,32,m);this.f=1}B($d,W);$d.prototype.v=function(){$d.d.v.call(this);td(this.a(),"separator")};Bd("goog-menuseparator",function(){return new $d});function ae(){}y(ae);function be(a,b){a&&(a.tabIndex=b?0:-1)}u=ae.prototype;u.j=function(a){return a.Pa().j("div",this.lb(a).join(" "))};u.w=function(a){return a};u.L=function(a){return"DIV"==a.tagName};u.Y=function(a,b){b.id&&a.Ga(b.id);var c=this.z(),d=m,e=Qb(b);e&&D(e,function(b){b==c?d=j:b&&(b==c+"-disabled"?a.J(m):b==c+"-horizontal"?ce(a,de):b==c+"-vertical"&&ce(a,ee))},this);d||Rb(b,c);fe(a,this.w(b));return b};
function fe(a,b){if(b)for(var c=b.firstChild,d;c&&c.parentNode==b;){d=c.nextSibling;if(1==c.nodeType){var e;a:{e=i;for(var g=Qb(c),h=0,l=g.length;h<l;h++)if(e=g[h]in Cd?Cd[g[h]]():k)break a;e=k}e&&(e.b=c,a.isEnabled()||e.J(m),a.La(e),e.Y(c))}else(!c.nodeValue||""==sa(c.nodeValue))&&b.removeChild(c);c=d}}u.Ua=function(a){a=a.a();Rc(a,j,H);G&&(a.hideFocus=j)};u.k=function(a){return a.a()};u.z=s("goog-container");
u.lb=function(a){var b=this.z(),c=[b,a.da==de?b+"-horizontal":b+"-vertical"];a.isEnabled()||c.push(b+"-disabled");return c};function Z(a,b,c){T.call(this,c);this.c=b||ae.N();this.da=a||ee}B(Z,T);var de="horizontal",ee="vertical";u=Z.prototype;u.rb=k;u.A=k;u.c=k;u.da=k;u.i=j;u.p=j;u.kb=j;u.n=-1;u.h=k;u.ca=m;u.Ab=m;u.kc=j;u.Q=k;u.k=function(){return this.rb||this.c.k(this)};u.Qa=function(){return this.A||(this.A=new md(this.k()))};u.j=function(){this.b=this.c.j(this)};u.w=function(){return this.c.w(this.a())};u.L=function(a){return this.c.L(a)};u.hb=function(a){this.b=this.c.Y(this,a);"none"==a.style.display&&(this.i=m)};
u.v=function(){Z.d.v.call(this);id(this,function(a){a.e&&ge(this,a)},this);var a=this.a();this.c.Ua(this);this.ta(this.i,j);R(R(R(R(R(R(R(R(Vc(this),this,"enter",this.Zb),this,"highlight",this.$b),this,"unhighlight",this.dc),this,"open",this.cc),this,"close",this.Xb),a,"mousedown",this.la),Q(a),"mouseup",this.Yb),a,["mousedown","mouseup","mouseover","mouseout"],this.Wb);this.ba()&&he(this,j)};
......
......@@ -145,6 +145,6 @@ todomvc.view.ToDoItemControl.prototype.setSelected = function(selected) {
var inputElement = this.getRenderer().getInputElement(
this.getElement());
inputElement.value = this.getContent();
inputElement.select();
inputElement.focus();
}
};
......@@ -846,7 +846,7 @@ function Tq(a,b,c){var d,e,f,g,i,j,k,n,o,p,q;q=c.ib();p=b+q;k=(!a.f?a.j:a.f).g;j
function am(a,b,c,d,e,f){var g,i,j,k,n,o,p;k=dm(b)-dm(a);g=nm(b,k);j=Yl(0,0,0);while(k>=0){i=fm(a,g);if(i){k<22?(j.l|=1<<k,undefined):k<44?(j.m|=1<<k-22,undefined):(j.h|=1<<k-44,undefined);if(a.l==0&&a.m==0&&a.h==0){break}}o=g.m;p=g.h;n=g.l;g.h=p>>>1;g.m=o>>>1|(p&1)<<21;g.l=n>>>1|(o&1)<<21;--k}c&&cm(j);if(f){if(d){Vl=mm(a);e&&(Vl=qm(Vl,(ym(),wm)))}else{Vl=Yl(a.l,a.m,a.h)}}return j}
function Hp(a){var b,c,d,e,f,g,i;c=a.srcElement;if(!Wc(c)){return}f=c;b=f;d=f.__listener;while(!!b&&!d){b=$c(b);d=!b?null:b.__listener}if(!Rh(d,30)){return}i=Ph(d,30);if(f==i.t){return}g=a.type;if(xz('focusin',g)){e=ed(f).toLowerCase();if(oE(up,e)){rp=f;tp=Gp(f);sp=!xz(WG,e)&&!Ip(f)}Dp(i,f,2048,null)}else if(xz('focusout',g)){Jp(i);rp=null;bd($doc,MG);Dp(i,f,4096,null)}else (xz(UG,g)||xz(VG,g))&&Ep(a,i.t,d)}
function Tl(){var a,b;!!$stats&&Cm('com.google.gwt.user.client.UserAgentAsserter');a=as();xz(zG,a)||($wnd.alert('ERROR: Possible problem with your *.gwt.xml module file.\nThe compile time user.agent value (ie8) does not match the runtime user.agent value ('+a+'). Expect more errors.\n'),undefined);!!$stats&&Cm('com.google.gwt.user.client.DocumentModeAsserter');Vr();!!$stats&&Cm('com.todo.client.GwtToDo');b=new Kx;new zx(b);Ts((St(),Wt()),b)}
function bx(a,b,c,d){var e,f,g,i,j,k;k=d.type;if(a.b==c){if(xz(qG,k)){i=d.keyCode||0;if(i==13){_w(b,c);a.b=null;fx(a,b,c)}i==27&&(a.b=null,fx(a,b,c))}if(xz(NG,k)&&!a.a){_w(b,c);a.b=null;fx(a,b,c)}}else{if(xz(fH,k)){a.b=c;fx(a,b,c);a.a=true;g=Mc(b.firstChild);g.focus();g.select();a.a=false}if(xz(pG,k)){f=d.srcElement;e=f;j=ed(e);if(xz(j,uH)){g=e;lx(c,!!g.checked);g.checked?Rc(b.firstChild,vH):Tc(b.firstChild,vH)}else xz(j,'BUTTON')&&tx(c.b,c)}}}
function bx(a,b,c,d){var e,f,g,i,j,k;k=d.type;if(a.b==c){if(xz(qG,k)){i=d.keyCode||0;if(i==13){_w(b,c);a.b=null;fx(a,b,c)}i==27&&(a.b=null,fx(a,b,c))}if(xz(NG,k)&&!a.a){_w(b,c);a.b=null;fx(a,b,c)}}else{if(xz(fH,k)){a.b=c;fx(a,b,c);a.a=true;g=Mc(b.firstChild);g.focus();a.a=false}if(xz(pG,k)){f=d.srcElement;e=f;j=ed(e);if(xz(j,uH)){g=e;lx(c,!!g.checked);g.checked?Rc(b.firstChild,vH):Tc(b.firstChild,vH)}else xz(j,'BUTTON')&&tx(c.b,c)}}}
function Uq(a,b,c){var d,e,f,g,i,j,k,n,o,p;p=b.b;g=b.a;if(p<0){throw new Ky('Range start cannot be less than 0')}if(g<0){throw new Ky('Range length cannot be less than 0')}k=(!a.f?a.j:a.f).g;i=(!a.f?a.j:a.f).f;n=k!=p;if(n){o=xq(a);if(!c){if(p>k){f=p-k;if((!a.f?a.j:a.f).k.b>f){for(e=0;e<f;++e){FC(o.k,0)}}else{CC(o.k)}}else{d=k-p;if((!a.f?a.j:a.f).k.b>0&&d<i){for(e=0;e<d;++e){AC(o.k,0,null)}zC(o.c,new Ew(p,p+d-p))}else{CC(o.k)}}}o.g=p}j=i!=g;j&&(xq(a).f=g);c&&CC(xq(a).k);Vq(a);(n||j)&&Ow(a.a,new Ew((!a.f?a.j:a.f).g,(!a.f?a.j:a.f).f))}
function Zl(a,b,c){var d,e,f,g,i,j;if(b.l==0&&b.m==0&&b.h==0){throw new Yx}if(a.l==0&&a.m==0&&a.h==0){c&&(Vl=Yl(0,0,0));return Yl(0,0,0)}if(b.h==524288&&b.m==0&&b.l==0){return $l(a,c)}j=false;if(b.h>>19!=0){b=mm(b);j=true}g=em(b);f=false;e=false;d=false;if(a.h==524288&&a.m==0&&a.l==0){e=true;f=true;if(g==-1){a=Xl((ym(),um));d=true;j=!j}else{i=om(a,g);j&&cm(i);c&&(Vl=Yl(0,0,0));return i}}else if(a.h>>19!=0){f=true;a=mm(a);d=true;j=!j}if(g!=-1){return _l(a,g,j,f,c)}if(!km(a,b)){c&&(f?(Vl=mm(a)):(Vl=Yl(a.l,a.m,a.h)));return Yl(0,0,0)}return am(d?a:Yl(a.l,a.m,a.h),b,j,f,e,c)}
function Qq(a,b,c,d){var e,f,g,i,j,k,n;if((yr(),wr)==a.d){return}xq(a).p=true;if(!d&&(wr==a.d?-1:(!a.f?a.j:a.f).d)==b&&(wr==a.d?null:(!a.f?a.j:a.f).e)!=null){return}j=(!a.f?a.j:a.f).g;i=(!a.f?a.j:a.f).f;n=(!a.f?a.j:a.f).i;e=j+b;e>=n&&(!a.f?a.j:a.f).j&&(e=n-1);b=(0>e?0:e)-j;a.c.a&&(b=0>(b<i-1?b:i-1)?0:b<i-1?b:i-1);g=j;f=i;k=xq(a);k.d=0;k.e=null;k.a=true;if(b>=0&&b<i){k.d=b;k.e=b<k.k.b?er(xq(a),b):null;k.b=c;return}else if((pr(),mr)==a.c){while(b<0){g-=i;b+=i}while(b>=i){g+=i;b-=i}}else if(or==a.c){while(b<0){f+=30;g-=30;b+=30}if(g<0){b+=g;f+=g;g=0}while(b>=f){f+=30}if((!a.f?a.j:a.f).j){f=f<n-g?f:n-g;b>=n&&(b=n-1)}}if(g!=j||f!=i){k.d=b;Uq(a,new Ew(g,f),false)}}
......
......@@ -764,7 +764,7 @@ function Mi(a,b){var c,d,e,f,g,i,j,k,n,o,p;d=b.srcElement;if(!oc(d)){return}o=b.
function Lj(a,b,c){var d,e,f,g,i,j,k,n,o,p,q;q=c.cb();p=b+q;k=(!a.f?a.j:a.f).g;j=(!a.f?a.j:a.f).g+(!a.f?a.j:a.f).f;e=b>k?b:k;d=p<j?p:j;if(b!=k&&e>=d){return}n=pj(a);f=nq(0,e-k-(!a.f?a.j:a.f).k.b);for(i=0;i<f;++i){Ws(n.k,null)}for(i=e;i<d;++i){o=c.Z(i-b);g=i-k;g<(!a.f?a.j:a.f).k.b?bt(n.k,g,o):Ws(n.k,o)}Ws(n.c,new zo(e-f,d-(e-f)));p>(!a.f?a.j:a.f).i&&Kj(a,p,(!a.f?a.j:a.f).j)}
function zf(a,b,c,d,e,f){var g,i,j,k,n,o,p;k=Cf(b)-Cf(a);g=Mf(b,k);j=vf(0,0,0);while(k>=0){i=Ef(a,g);if(i){k<22?(j.l|=1<<k,undefined):k<44?(j.m|=1<<k-22,undefined):(j.h|=1<<k-44,undefined);if(a.l==0&&a.m==0&&a.h==0){break}}o=g.m;p=g.h;n=g.l;g.h=p>>>1;g.m=o>>>1|(p&1)<<21;g.l=n>>>1|(o&1)<<21;--k}c&&Bf(j);if(f){if(d){sf=Lf(a);e&&(sf=Pf(sf,(Xf(),Vf)))}else{sf=vf(a.l,a.m,a.h)}}return j}
function Bi(a){var b,c,d,e,f,g,i;c=a.srcElement;if(!oc(c)){return}f=c;b=f;d=f.__listener;while(!!b&&!d){b=sc(b);d=!b?null:b.__listener}if(!Xe(d,25)){return}i=Ve(d,25);if(f==i.t){return}g=a.type;if(xq(Bx,g)){e=yc(f).toLowerCase();if(vu(pi,e)){mi=f;oi=Ai(f);ni=!xq(sx,e)&&!Ci(f)}yi(i,f,2048,null)}else if(xq(Cx,g)){Di(i);mi=null;vc($doc,ax);yi(i,f,4096,null)}else (xq(qx,g)||xq(rx,g))&&zi(a,i.t,d)}
function So(a,b,c,d){var e,f,g,i,j,k;k=d.type;if(a.b==c){if(xq(jw,k)){i=d.keyCode||0;if(i==13){Qo(b,c);a.b=null;Wo(a,b,c)}i==27&&(a.b=null,Wo(a,b,c))}if(xq(bx,k)&&!a.a){Qo(b,c);a.b=null;Wo(a,b,c)}}else{if(xq(xy,k)){a.b=c;Wo(a,b,c);a.a=true;g=ec(b.firstChild);g.focus();g.select();a.a=false}if(xq(iw,k)){f=d.srcElement;e=f;j=yc(e);if(xq(j,Fz)){g=e;_o(c,!!g.checked);g.checked?jc(b.firstChild,Hz):lc(b.firstChild,Hz)}else xq(j,Iz)&&fp(c.b,c)}}}
function So(a,b,c,d){var e,f,g,i,j,k;k=d.type;if(a.b==c){if(xq(jw,k)){i=d.keyCode||0;if(i==13){Qo(b,c);a.b=null;Wo(a,b,c)}i==27&&(a.b=null,Wo(a,b,c))}if(xq(bx,k)&&!a.a){Qo(b,c);a.b=null;Wo(a,b,c)}}else{if(xq(xy,k)){a.b=c;Wo(a,b,c);a.a=true;g=ec(b.firstChild);g.focus();a.a=false}if(xq(iw,k)){f=d.srcElement;e=f;j=yc(e);if(xq(j,Fz)){g=e;_o(c,!!g.checked);g.checked?jc(b.firstChild,Hz):lc(b.firstChild,Hz)}else xq(j,Iz)&&fp(c.b,c)}}}
function Mj(a,b,c){var d,e,f,g,i,j,k,n,o,p;p=b.b;g=b.a;if(p<0){throw new Wp(Zx)}if(g<0){throw new Wp($x)}k=(!a.f?a.j:a.f).g;i=(!a.f?a.j:a.f).f;n=k!=p;if(n){o=pj(a);if(!c){if(p>k){f=p-k;if((!a.f?a.j:a.f).k.b>f){for(e=0;e<f;++e){at(o.k,0)}}else{Zs(o.k)}}else{d=k-p;if((!a.f?a.j:a.f).k.b>0&&d<i){for(e=0;e<d;++e){Xs(o.k,0,null)}Ws(o.c,new zo(p,p+d-p))}else{Zs(o.k)}}}o.g=p}j=i!=g;j&&(pj(a).f=g);c&&Zs(pj(a).k);Nj(a);(n||j)&&Ho(a.a,new zo((!a.f?a.j:a.f).g,(!a.f?a.j:a.f).f))}
function wf(a,b,c){var d,e,f,g,i,j;if(b.l==0&&b.m==0&&b.h==0){throw new Cp}if(a.l==0&&a.m==0&&a.h==0){c&&(sf=vf(0,0,0));return vf(0,0,0)}if(b.h==524288&&b.m==0&&b.l==0){return xf(a,c)}j=false;if(b.h>>19!=0){b=Lf(b);j=true}g=Df(b);f=false;e=false;d=false;if(a.h==524288&&a.m==0&&a.l==0){e=true;f=true;if(g==-1){a=uf((Xf(),Tf));d=true;j=!j}else{i=Nf(a,g);j&&Bf(i);c&&(sf=vf(0,0,0));return i}}else if(a.h>>19!=0){f=true;a=Lf(a);d=true;j=!j}if(g!=-1){return yf(a,g,j,f,c)}if(!Jf(a,b)){c&&(f?(sf=Lf(a)):(sf=vf(a.l,a.m,a.h)));return vf(0,0,0)}return zf(d?a:vf(a.l,a.m,a.h),b,j,f,e,c)}
function Yk(a){switch(a){case bx:return 4096;case fx:return 1024;case iw:return 1;case xy:return 2;case ax:return 2048;case cx:return 128;case yy:return 256;case jw:return 512;case qx:return 32768;case zy:return 8192;case dx:return 4;case Ay:return 64;case Sw:return 32;case By:return 16;case yx:return 8;case Cy:return 16384;case rx:return 65536;case Dy:case zx:return 131072;case Ey:return 262144;case Fy:return 524288;case Gy:return 1048576;case Hy:return 2097152;case Iy:return 4194304;case Jy:return 8388608;case Ky:return 16777216;case Ly:return 33554432;case My:return 67108864;default:return -1;}}
......
......@@ -139,7 +139,6 @@ public class ToDoCell extends AbstractCell<ToDoItem> {
beginningEdit = true;
InputElement input = getInputElement(parent);
input.focus();
input.select();
beginningEdit = false;
}
......
......@@ -17,7 +17,7 @@
init: function(element, value_accessor, all_bindings_accessor) {
ko.bindingHandlers.hasfocus.init(element, value_accessor, all_bindings_accessor);
return ko.utils.registerEventHandler(element, 'focus', function() {
return element.select();
return element.focus();
});
},
update: function(element, value_accessor) {
......
......@@ -45,7 +45,7 @@
this.onCheckEditBegin = function() {
if (!_this.editing() && !_this.completed()) {
_this.editing(true);
return $('.todo-input').focus();
return;
}
};
this.onCheckEditEnd = function(view_model, event) {
......
......@@ -33,7 +33,7 @@
init: function( element, valueAccessor, allBindingsAccessor ) {
ko.bindingHandlers.hasfocus.init( element, valueAccessor, allBindingsAccessor );
ko.utils.registerEventHandler( element, 'focus', function() {
element.select();
element.focus();
});
},
update: function( element, valueAccessor ) {
......
......@@ -50,7 +50,7 @@ class Alfred.TodosController extends Batman.Controller
editing = todo.set('editing', !todo.get('editing'))
if editing
input = document.getElementById("todo-input-#{todo.get('id')}")
input.select()
input.focus()
else
if todo.get('title')?.length > 0
todo.save (err, todo) ->
......
......@@ -118,7 +118,7 @@
editing = todo.set('editing', !todo.get('editing'));
if (editing) {
input = document.getElementById("todo-input-" + (todo.get('id')));
return input.select();
return input.focus();
} else {
if (((_ref = todo.get('title')) != null ? _ref.length : void 0) > 0) {
return todo.save(function(err, todo) {
......
......@@ -185,7 +185,7 @@ Todos = can.Control({
// Listen for editing a Todo
'.todo dblclick' : function(el) {
can.data(el, 'todo').attr('editing', true).save(function(){
dijit.focus(el.children('.edit')[0].select());
dijit.focus(el.children('.edit')[0].focus());
});
},
......
......@@ -140,7 +140,7 @@ Todos = can.Control({
// Listen for editing a Todo
'.todo dblclick' : function(el) {
can.data(el, 'todo').attr('editing', true).save(function(){
dijit.focus(el.children('.edit')[0].select());
dijit.focus(el.children('.edit')[0].focus());
});
},
......
......@@ -163,7 +163,7 @@ Todos = can.Control({
// Listen for editing a Todo
'.todo dblclick' : function(el, ev) {
el.data('todo').attr('editing', true).save(function() {
el.children('.edit').focus().select();
el.children('.edit').focus();
});
},
......
......@@ -128,7 +128,7 @@ Todos = can.Control({
// Listen for editing a Todo
'.todo dblclick' : function(el, ev) {
el.data('todo').attr('editing', true).save(function() {
el.children('.edit').focus().select();
el.children('.edit').focus();
});
},
......
......@@ -132,7 +132,6 @@ Todos = can.Control({
el.retrieve('todo')[0].attr('editing', true).save(function() {
var edit = el.getElement('.edit')[0];
edit.focus();
edit.select();
});
},
......
......@@ -172,7 +172,7 @@ Todos = can.Control({
// Listen for editing a Todo
'.todo dblclick' : function(el) {
el.getData('todo').attr('editing', true).save(function() {
el.one('.edit').focus().select();
el.one('.edit').focus();
});
},
......
......@@ -130,7 +130,7 @@ Todos = can.Control({
// Listen for editing a Todo
'.todo dblclick' : function(el) {
el.getData('todo').attr('editing', true).save(function() {
el.one('.edit').focus().select();
el.one('.edit').focus();
});
},
......
......@@ -33,7 +33,7 @@ define(function () {
* @param node {Node} Dom node of the todo
*/
beginEditTodo: function(node) {
this.querySelector('.edit', node).select();
this.querySelector('.edit', node).focus();
},
/**
......
......@@ -25,7 +25,7 @@ maria.ElementView.subclass(checkit, 'TodoView', {
var input = this.find('.todo-input');
input.value = this.getModel().getContent();
aristocrat.addClass(this.find('.todo'), 'editing');
input.select();
input.focus();
},
showDisplay: function() {
aristocrat.removeClass(this.find('.todo'), 'editing');
......
......@@ -84,7 +84,7 @@ if Meteor.is_client
# force DOM redraw, so we can select the edit field
Meteor.flush()
$('.edit').select()
$('.edit').focus()
'blur input.edit': (evt) ->
text = $(evt.target).val().trim()
......
......@@ -119,7 +119,7 @@ exports.TodoView = Montage.create(Component, {
value: function() {
if (this.isEditing) {
this.element.classList.add("editing");
this.editInput.element.select();
this.editInput.element.focus();
} else {
this.element.classList.remove("editing");
this.editInput.element.blur();
......
......@@ -16,7 +16,7 @@
this.editing( true );
var self = this;
setTimeout(function() {
$( self.el ).parent().find('input.edit').select();
$( self.el ).parent().find('input.edit').focus();
}, 0);
},
......
......@@ -45,7 +45,7 @@ function List( OObject, EventPlugin, ModelPlugin, Tools ) {
var taskId = node.getAttribute('data-model_id');
Tools.toggleClass.call( view.querySelector('li[data-model_id="' + taskId + '"]'), true, 'editing' );
view.querySelector('input.edit[data-model_id="' + taskId + '"]').select();
view.querySelector('input.edit[data-model_id="' + taskId + '"]').focus();
};
// Leave edit mode
......
......@@ -57,7 +57,7 @@ function xc(a,b){"-"==b.charAt(0)&&(b="."+b.substring(1));var c;if("."==b.charAt
n.bind=function(a,b,c){a=this.l.bind(a,b,c||this);this.N.push(a);return a};n.ea=function(a,b){var c=this.l.ea(a,b||this);this.N.push(c);return c};n.fa=function(a,b){var c=this.l.fa(a,b||this);this.N.push(c);return c};n.ta=function(a,b){var c=this.l.ta(a,b||this);this.N.push(c);return c};n.Da=function(a,b){var c=this.l.Da(a,b||this);this.N.push(c);return c};n.t=function(a){return this.l.t(a)};n.d=function(){B(this.N,function(a){this.t(a)},this);this.r=k;Z.j.d.call(this)};F&&J(8);var yc={};"ScriptEngine"in o&&"JScript"==o.ScriptEngine()&&(o.ScriptEngineMajorVersion(),o.ScriptEngineMinorVersion(),o.ScriptEngineBuildVersion());function zc(a){return"object"===typeof a&&a&&0===a.Hb?a.content:(""+a).replace(Ac,Bc)}var Cc={"\x00":"&#0;",'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;","\t":"&#9;","\n":"&#10;","\x0B":"&#11;","\u000c":"&#12;","\r":"&#13;"," ":"&#32;","-":"&#45;","/":"&#47;","=":"&#61;","`":"&#96;","\u0085":"&#133;","\u00a0":"&#160;","\u2028":"&#8232;","\u2029":"&#8233;"};function Bc(a){return Cc[a]}var Ac=/[\x00\x22\x26\x27\x3c\x3e]/g;function Dc(a){Z.call(this,a)}y(Dc,Z);
Dc.prototype.xa=function(){var a={g:this.l.ra()},b=new nb(k)||mb(),a="<li "+((a||yc).g.completed?'class="completed"':"")+'><div class="view"><input class="toggle" type="checkbox" '+((a||yc).g.completed?"checked":"")+"><label>"+zc((a||yc).g.title)+'</label><button class="destroy"></button></div><input class="edit" type="text" value=""></li>';var c=b.B,b=c.createElement("div");F?(b.innerHTML="<br>"+a,b.removeChild(b.firstChild)):b.innerHTML=a;if(1==b.childNodes.length)a=b.removeChild(b.firstChild);
else for(a=c.createDocumentFragment();b.firstChild;)a.appendChild(b.firstChild);this.h=a};
Dc.prototype.C=function(){var a=this.l;this.click(function(b){a.set("completed",b.target.checked)},"toggle");this.click(function(){a.k()},"destroy");wc(this,"dblclick",function(){var a=xc(this,".edit")[0];eb(this.w(),"editing");a.value=this.l.get("title");a.select()},"view");var b=xc(this,".edit")[0];wc(this,"keyup",function(c){13===c.keyCode&&a.set("title",b.value)},"edit");wc(this,"blur",function(){a.set("title",b.value)},"edit")};function Ec(a){Z.call(this,a);this.Qa=Fc}y(Ec,Z);function Fc(){return j}function Gc(a){return!a.get("completed")}function Hc(a){return a.get("completed")}
Dc.prototype.C=function(){var a=this.l;this.click(function(b){a.set("completed",b.target.checked)},"toggle");this.click(function(){a.k()},"destroy");wc(this,"dblclick",function(){var a=xc(this,".edit")[0];eb(this.w(),"editing");a.value=this.l.get("title");a.focus()},"view");var b=xc(this,".edit")[0];wc(this,"keyup",function(c){13===c.keyCode&&a.set("title",b.value)},"edit");wc(this,"blur",function(){a.set("title",b.value)},"edit")};function Ec(a){Z.call(this,a);this.Qa=Fc}y(Ec,Z);function Fc(){return j}function Gc(a){return!a.get("completed")}function Hc(a){return a.get("completed")}
Ec.prototype.C=function(){Ec.j.C.call(this);var a=this.l,b=xc(this,"input")[0];wc(this,"keyup",function(c){13===c.keyCode&&(c=la(b.value),""!==c&&(c=new a.Va({title:c}),a.add(c,0,i),b.value=""))},"todo-entry");this.click(function(){B(a.get("completed"),function(a){a.k()})},"clear-completed");this.click(function(b){var d=b.target.checked;B(Ub(a),function(a){a.set("completed",d)})},"toggle-all");this.ta(function(){this.refresh();a.save()},this);this.Da(function(){Ic(!!a.a.length)},this);Ic(!!a.a.length);
this.bind("completed",function(b){var d=M("todo-count"),e;e=a.a.length-b.length;e="<strong>"+zc(e)+"</strong> item"+(1!=e?"s":"")+" left";d.innerHTML=e;d=M("clear-completed");e="Clear completed ("+b.length+")";if("textContent"in d)d.textContent=e;else if(d.firstChild&&3==d.firstChild.nodeType){for(;d.lastChild!=d.firstChild;)d.removeChild(d.lastChild);d.firstChild.data=e}else tb(d),d.appendChild(L(d).createTextNode(e));d.style.display=b.length?"":"none";xc(this,".toggle-all")[0].checked=b.length===
a.a.length});a.aa.Za(a,i)};function Ic(a){var b=M("main"),c=ob("footer",i,i)[0];b.style.display=a?"":"none";c.style.display=a?"":"none"}function Jc(a){var b=Kc;b.Qa=a;b.refresh()}
......
......@@ -59,7 +59,7 @@ todomvc.todocontrol.prototype.enterDocument = function() {
this.on( goog.events.EventType.DBLCLICK, function( e ) {
goog.dom.classes.add( this.getElement(), 'editing' );
inputEl.value = model.get('title');
inputEl.select();
inputEl.focus();
}, 'view' );
// Save on edit
......
......@@ -18,7 +18,7 @@
this.set( 'editing', true );
e.preventDefault();
this.$.inputElement.$el.select();
this.$.inputElement.$el.focus();
return false;
},
......
......@@ -39,7 +39,7 @@ var todo = window.todo || {};
},
edit: function( event ) {
$( this ).closest('li').addClass('editing').find('.edit').select();
$( this ).closest('li').addClass('editing').find('.edit').focus();
},
update: function( event ) {
......
......@@ -181,7 +181,7 @@ define( [ "troopjs-core/component/widget", "troopjs-core/store/local", "jquery",
$input
.val(items[index].title)
.removeProp("disabled")
.select();
.focus();
})
.fail(function failGet() {
$li.removeClass("editing");
......
......@@ -9,7 +9,6 @@ define(['app'], function ( app ) {
if ( newval ) {
$timeout(function() {
elem[0].focus();
elem[0].select();
}, 0, false);
}
});
......
......@@ -32,7 +32,7 @@ define([
init: function( element, valueAccessor, allBindingsAccessor ) {
ko.bindingHandlers.hasfocus.init( element, valueAccessor, allBindingsAccessor );
ko.utils.registerEventHandler( element, 'focus', function() {
element.select();
element.focus();
} );
},
update: function( element, valueAccessor ) {
......
......@@ -82,7 +82,7 @@
inputEditTodo = document.getElementById( 'input_' + todoId );
div.className = 'editing';
inputEditTodo.select();
inputEditTodo.focus();
}
function checkboxChangeHandler( event ) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment