aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisko Hevery2010-02-04 15:12:34 -0800
committerMisko Hevery2010-02-04 15:12:34 -0800
commit5eb440c22bb87b1d69c14193954620b9f1cec023 (patch)
tree4ecbf10abc61bf4a04e268233a46c678f73542e8
parent251fab40291183c8e50ea0fabd23c30341cc72d3 (diff)
downloadangular.js-5eb440c22bb87b1d69c14193954620b9f1cec023.tar.bz2
lazy load the status dom
-rw-r--r--angular-minified.js4
-rw-r--r--angular.js4
-rw-r--r--src/Widgets.js4
3 files changed, 6 insertions, 6 deletions
diff --git a/angular-minified.js b/angular-minified.js
index b00e58a2..4799465c 100644
--- a/angular-minified.js
+++ b/angular-minified.js
@@ -12,7 +12,7 @@ ea(a,f,g,d);e=true}}catch(l){}}a.push("}")}typeof b=="object"&&d.pop()}function
this.uc="_"+(""+Math.random()).substr(2)+"_";this.ma=1800}function da(a){this.frame=a}function oa(a,b,c){this.xb=a;this.update=c;this.status=b}function pa(a,b){this.oc=a;this.ha=b}function ma(a,b){this.Ub=0;this.ea=a;this.ja=b;this.vb=o.swfobject?o.swfobject.createSWF:function(){alert("ERROR: swfobject not loaded!")}}function U(a,b,c,d){this.view=a;this.sc=c;this.J=b;this.wa=d+"/_attachments";this.value=null;this.c=undefined}function R(a){this.view=a}function ra(a,b,c){this.view=a;this.A=c;this.exp=
b;this.Q=a.getAttribute("ng-validate");this.lc=typeof a.attributes["ng-required"]!="undefined";this.Da=null;this.c=undefined;this.w=this.A.parse(a.value);a.getAttribute("ng-widget")==="datepicker"&&k(a).Gc()}function sa(a,b,c){this.view=a;this.exp=b;this.c=undefined;this.A=c;this.w=this.A.parse(a.checked?a.value:"")}function ta(a,b){this.view=a;this.exp=b;this.c=undefined;this.w=a.value}function ua(a,b){this.view=a;this.exp=b;this.c=undefined;this.w=this.selected()}function va(a,b){this.view=a;this.exp=
b;this.c=this.ka=undefined;this.Ca=a.value;this.w=a.checked?a.value:null}function N(a,b){this.view=a;this.exp=x.aa(b);this.C=false;this.nc={element:a}}function wa(a,b){this.view=a;this.nb=b}function xa(a,b){this.view=a;this.exp=b;this.C=false}function ya(a,b){this.view=a;this.exp=b}function za(a,b){this.view=a;this.exp=b}function Aa(a,b){this.view=a;this.exp=b}function Ba(a,b){this.view=a;this.exp=b}function Ca(a,b){this.view=a;this.exp=b}function Da(a,b){this.view=a;this.exp=b}function Ea(a,b,c,
-d){this.view=a;this.template=c;this.prefix=d;this.children=[];a=b.match(/^\s*(.+)\s+in\s+(.*)\s*$/);if(!a)throw"Expected ng-repeat in form of 'item in collection' but got '"+b+"'.";b=a[1];this.Y=a[2];a=b.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);if(!a)throw"'item' in 'item in collection' should be identifier or (key, value) but get '"+b+"'.";this.wc=a[3]||a[1];this.Ob=a[2]}function A(a){this.F=a}function Y(a){this.Ia=a.append(Y.$a).find("#ng-loading");this.da=0}var fa={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",
+d){this.view=a;this.template=c;this.prefix=d;this.children=[];a=b.match(/^\s*(.+)\s+in\s+(.*)\s*$/);if(!a)throw"Expected ng-repeat in form of 'item in collection' but got '"+b+"'.";b=a[1];this.Y=a[2];a=b.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);if(!a)throw"'item' in 'item in collection' should be identifier or (key, value) but get '"+b+"'.";this.wc=a[3]||a[1];this.Ob=a[2]}function A(a){this.F=a}function Y(a){this.da=0;this.body=a}var fa={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",
zb:function(a){var b="",c,d,e,f,g,h,i=0;for(a=fa.hb(a);i<a.length;){c=a.charCodeAt(i++);d=a.charCodeAt(i++);e=a.charCodeAt(i++);f=c>>2;c=(c&3)<<4|d>>4;g=(d&15)<<2|e>>6;h=e&63;if(isNaN(d))g=h=64;else if(isNaN(e))h=64;b=b+this.B.charAt(f)+this.B.charAt(c)+this.B.charAt(g)+this.B.charAt(h)}return b},Ic:function(a){var b="",c,d,e,f,g,h=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;){c=this.B.indexOf(a.charAt(h++));d=this.B.indexOf(a.charAt(h++));f=this.B.indexOf(a.charAt(h++));g=this.B.indexOf(a.charAt(h++));
c=c<<2|d>>4;d=(d&15)<<4|f>>2;e=(f&3)<<6|g;b+=String.fromCharCode(c);if(f!=64)b+=String.fromCharCode(d);if(g!=64)b+=String.fromCharCode(e)}return b=fa.gb(b)},hb:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128)b+=String.fromCharCode(d);else{if(d>127&&d<2048)b+=String.fromCharCode(d>>6|192);else{b+=String.fromCharCode(d>>12|224);b+=String.fromCharCode(d>>6&63|128)}b+=String.fromCharCode(d&63|128)}}return b},gb:function(a){for(var b="",c=0,d=c1=c2=
0;c<a.length;){d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d);c++}else if(d>191&&d<224){c2=a.charCodeAt(c+1);b+=String.fromCharCode((d&31)<<6|c2&63);c+=2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c+=3}}return b}};if(typeof y.getAttribute=="undefined")y.getAttribute=K();if(typeof Node=="undefined")Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,
@@ -100,4 +100,4 @@ this.exp,{},function(b){var c=k(this.view);W(b)?c.hide():c.show()})}};za.prototy
k(this.view).toggleClass(b,c%2===0)})}};Da.prototype={e:n,d:function(a){a.l(this,this.exp,{},function(b){k(this.view).attr("style","").css(b)})}};Ea.prototype={e:n,d:function(a){a.l(this,this.Y,{},function(b){var c=this;if(!b){b=[];a.Lb(this.Y)&&a.i(this.Y,b)}var d=b.length,e=this.children.length,f=this.view,g=0,h=null,i=this.Ob,j=this.wc,l=0;p(b,function(C,s){if(l<e){h=c.children[l];h.scope.i(j,C)}else{var t=new v(a.q,c.prefix+j+" in "+c.Y+"["+l+"]");t.i("$index",l);i&&t.i(i,s);t.i(j,C);h={scope:t,
element:c.template(t,c.prefix,l)};f.after(h.element);c.children.push(h)}f=h.element;C=(new Date).getTime();h.scope.d();g+=(new Date).getTime()-C;l++});for(b=e;b>d;--b){var q=this.children.pop().element[0];q.parentNode.removeChild(q)}if(h&&h.element[0].nodeName==="OPTION")if(d=k(h.element[0].parentNode).data("controller")){d.c=undefined;d.d(a)}})}};A.ta="mouseleave mouseout click dblclick keypress keyup";A.fc=function(){A.oa();var a=k(this);a.bind(A.ta,A.oa);var b=a.position(),c=y.documentElement,
d=(self.innerWidth||c&&c.clientWidth||y.body.clientWidth)-b.left;c=a.hasClass("ng-exception")?"EXCEPTION:":"Validation error...";a=a.attr("ng-error");d=d>375?"left":"right";c=k("<div id='ng-callout' style='width:300px'><div class='ng-arrow-"+d+"'/><div class='ng-title'>"+c+"</div><div class='ng-content'>"+a+"</div></div>");k("body").append(c);if(d==="left")a=b.left+this.offsetWidth+11;else{a=b.left-315;c.find(".ng-arrow-right").css({left:301})}c.css({left:a+"px",top:b.top-3+"px"});return true};A.oa=
-function(){k("#ng-callout").unbind(A.ta,A.oa).remove();return true};A.prototype={bind:function(){this.F.find(".ng-validation-error,.ng-exception").live("mouseover",A.fc)}};Y.$a='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';Y.prototype={pb:function(){this.da===0&&this.Ia.show();this.da++},Ab:function(){this.da--;this.da===0&&this.Ia.hide("fold")}}})(window,document);
+function(){k("#ng-callout").unbind(A.ta,A.oa).remove();return true};A.prototype={bind:function(){this.F.find(".ng-validation-error,.ng-exception").live("mouseover",A.fc)}};Y.$a='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';Y.prototype={pb:function(){if(this.da===0)(this.Ia=this.Ia||this.body.append(Y.$a).find("#ng-loading")).show();this.da++},Ab:function(){this.da--;this.da===0&&this.Ia.hide("fold")}}})(window,document);
diff --git a/angular.js b/angular.js
index f753763c..887ac24e 100644
--- a/angular.js
+++ b/angular.js
@@ -4027,8 +4027,8 @@ PopUp.prototype = {
function Status(body) {
- this.loader = body.append(Status.DOM).find("#ng-loading");
this.requestCount = 0;
+ this.body = body;
};
Status.DOM ='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';
@@ -4036,7 +4036,7 @@ Status.DOM ='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';
Status.prototype = {
beginRequest: function () {
if (this.requestCount === 0) {
- this.loader.show();
+ (this.loader = this.loader || this.body.append(Status.DOM).find("#ng-loading")).show();
}
this.requestCount++;
},
diff --git a/src/Widgets.js b/src/Widgets.js
index 01877128..5e844ae0 100644
--- a/src/Widgets.js
+++ b/src/Widgets.js
@@ -779,8 +779,8 @@ PopUp.prototype = {
function Status(body) {
- this.loader = body.append(Status.DOM).find("#ng-loading");
this.requestCount = 0;
+ this.body = body;
};
Status.DOM ='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';
@@ -788,7 +788,7 @@ Status.DOM ='<div id="ng-spacer"></div><div id="ng-loading">loading....</div>';
Status.prototype = {
beginRequest: function () {
if (this.requestCount === 0) {
- this.loader.show();
+ (this.loader = this.loader || this.body.append(Status.DOM).find("#ng-loading")).show();
}
this.requestCount++;
},