Bundled output for commit f9f7bcd787 [skip ci]
This commit is contained in:
parent
6da45aa871
commit
b32d0cdea3
2 changed files with 8 additions and 8 deletions
|
|
@ -680,11 +680,11 @@ var renderService = function($window) {
|
|||
}
|
||||
//style
|
||||
function updateStyle(element, old, style) {
|
||||
if (old === style) element.cssText = "", old = null
|
||||
if (style == null) element.cssText = ""
|
||||
else if (typeof style === "string") element.cssText = style
|
||||
if (old === style) element.style.cssText = "", old = null
|
||||
if (style == null) element.style.cssText = ""
|
||||
else if (typeof style === "string") element.style.cssText = style
|
||||
else {
|
||||
if (typeof old === "string") element.cssText = ""
|
||||
if (typeof old === "string") element.style.cssText = ""
|
||||
for (var key in style) {
|
||||
element.style[key] = style[key]
|
||||
}
|
||||
|
|
|
|||
8
mithril.min.js
vendored
8
mithril.min.js
vendored
|
|
@ -21,10 +21,10 @@ c&&(f.domSize=c)}break;default:a=m;h=f.dom=c.dom;switch(f.tag){case "svg":a="htt
|
|||
c,null,!1),g(a,d(f,b,void 0),h)}function l(a){var c=a.domSize;if(null!=c||null==a.dom){var f=x.createDocumentFragment();if(0<c){for(a=a.dom;--c;)f.appendChild(a.nextSibling);f.insertBefore(a,f.firstChild)}return f}return a.dom}function m(a,c,f){for(;c<a.length;c++)if(null!=a[c]&&null!=a[c].dom)return a[c].dom;return f}function g(a,c,f){f&&f.parentNode?a.insertBefore(c,f):a.appendChild(c)}function p(a,c,f,b,g){for(;f<b;f++){var h=c[f];null!=h&&(h.skip?h.skip=void 0:z(a,h,g,!1))}}function z(a,c,f,b){if(!1===
|
||||
b){var g=0,d=0;b=function(){++d===g&&z(a,c,f,!0)};c.attrs&&c.attrs.onbeforeremove&&(g++,c.attrs.onbeforeremove.call(c.state,c,b));"string"!==typeof c.tag&&c.tag.onbeforeremove&&(g++,c.tag.onbeforeremove.call(c.state,c,b));if(0<g)return}h(c);if(c.dom){b=c.domSize||1;if(1<b)for(var p=c.dom;--b;)a.removeChild(p.nextSibling);null!=c.dom.parentNode&&a.removeChild(c.dom);null==f||null!=c.domSize||v(c.attrs)||"string"!==typeof c.tag||(f.pool?f.pool.push(c):f.pool=[c])}}function h(a){a.attrs&&a.attrs.onremove&&
|
||||
a.attrs.onremove.call(a.state,a);"string"!==typeof a.tag&&a.tag.onremove&&a.tag.onremove.call(a.state,a);if(null!=a.instance)h(a.instance);else if(a=a.children,a instanceof Array)for(var c=0;c<a.length;c++){var b=a[c];null!=b&&h(b)}}function A(a,c,b,g,h){var d=a.dom;if("key"!==c&&(b!==g||"value"===c||"checked"===c||"selectedIndex"===c||"selected"===c&&a.dom===x.activeElement||"object"===typeof g)&&"undefined"!==typeof g&&"oninit"!==c&&"oncreate"!==c&&"onupdate"!==c&&"onremove"!==c&&"onbeforeremove"!==
|
||||
c&&"onbeforeupdate"!==c){var p=c.indexOf(":");if(-1<p&&"xlink"===c.substr(0,p))d.setAttributeNS("http://www.w3.org/1999/xlink",c.slice(p+1),g);else if("o"===c[0]&&"n"===c[1]&&"function"===typeof g)B(a,c,g);else if("style"===c)if(a=b,a===g&&(d.cssText="",a=null),null==g)d.cssText="";else if("string"===typeof g)d.cssText=g;else{"string"===typeof a&&(d.cssText="");for(var e in g)d.style[e]=g[e];if(null!=a&&"string"!==typeof a)for(e in a)e in g||(d.style[e]="")}else if(c in d&&"href"!==c&&"list"!==c&&
|
||||
"form"!==c&&void 0===h){if("input"!==a.tag||"value"!==c||a.dom.value!==g||a.dom!==x.activeElement)d[c]=g}else"boolean"===typeof g?g?d.setAttribute(c,""):d.removeAttribute(c):d.setAttribute("className"===c?"class":c,g)}}function v(a){return null!=a&&(a.oncreate||a.onupdate||a.onbeforeremove||a.onremove)}function B(a,c,g){var b=a.dom,d=function(a){var c=g.call(b,a);"function"===typeof E&&E.call(b,a);return c};if(c in b)b[c]=d;else{var h=c.slice(2);void 0===a.events&&(a.events={});null!=a.events[c]&&
|
||||
b.removeEventListener(h,a.events[c],!1);a.events[c]=d;b.addEventListener(h,a.events[c],!1)}}function n(a,c,b){"function"===typeof a.oninit&&a.oninit.call(c.state,c);"function"===typeof a.oncreate&&b.push(a.oncreate.bind(c.state,c))}function y(a,c,b,g){g?n(a,c,b):"function"===typeof a.onupdate&&b.push(a.onupdate.bind(c.state,c))}function C(a){if(a instanceof Array){for(var c=[],b=0;b<a.length;b++)c[b]=a[b];return c}if("object"===typeof a){c={};for(b in a)c[b]=a[b];return c}return a}var x=a.document,
|
||||
D=x.createDocumentFragment(),E;return{render:function(a,c){var b=[],g=x.activeElement;null==a.vnodes&&(a.textContent="");c instanceof Array||(c=[c]);k(a,a.vnodes,u.normalizeChildren(c),b,null,void 0);a.vnodes=c;for(var d=0;d<b.length;d++)b[d]();x.activeElement!==g&&g.focus()},setEventCallback:function(a){return E=a}}}(window),M=function(a){function b(a,e){if(e instanceof Array)for(var l=0;l<e.length;l++)b(a+"["+l+"]",e[l]);else if("[object Object]"===Object.prototype.toString.call(e))for(l in e)b(a+
|
||||
c&&"onbeforeupdate"!==c){var p=c.indexOf(":");if(-1<p&&"xlink"===c.substr(0,p))d.setAttributeNS("http://www.w3.org/1999/xlink",c.slice(p+1),g);else if("o"===c[0]&&"n"===c[1]&&"function"===typeof g)B(a,c,g);else if("style"===c)if(a=b,a===g&&(d.style.cssText="",a=null),null==g)d.style.cssText="";else if("string"===typeof g)d.style.cssText=g;else{"string"===typeof a&&(d.style.cssText="");for(var e in g)d.style[e]=g[e];if(null!=a&&"string"!==typeof a)for(e in a)e in g||(d.style[e]="")}else if(c in d&&
|
||||
"href"!==c&&"list"!==c&&"form"!==c&&void 0===h){if("input"!==a.tag||"value"!==c||a.dom.value!==g||a.dom!==x.activeElement)d[c]=g}else"boolean"===typeof g?g?d.setAttribute(c,""):d.removeAttribute(c):d.setAttribute("className"===c?"class":c,g)}}function v(a){return null!=a&&(a.oncreate||a.onupdate||a.onbeforeremove||a.onremove)}function B(a,c,g){var b=a.dom,d=function(a){var c=g.call(b,a);"function"===typeof E&&E.call(b,a);return c};if(c in b)b[c]=d;else{var h=c.slice(2);void 0===a.events&&(a.events=
|
||||
{});null!=a.events[c]&&b.removeEventListener(h,a.events[c],!1);a.events[c]=d;b.addEventListener(h,a.events[c],!1)}}function n(a,c,b){"function"===typeof a.oninit&&a.oninit.call(c.state,c);"function"===typeof a.oncreate&&b.push(a.oncreate.bind(c.state,c))}function y(a,c,b,g){g?n(a,c,b):"function"===typeof a.onupdate&&b.push(a.onupdate.bind(c.state,c))}function C(a){if(a instanceof Array){for(var c=[],b=0;b<a.length;b++)c[b]=a[b];return c}if("object"===typeof a){c={};for(b in a)c[b]=a[b];return c}return a}
|
||||
var x=a.document,D=x.createDocumentFragment(),E;return{render:function(a,c){var b=[],g=x.activeElement;null==a.vnodes&&(a.textContent="");c instanceof Array||(c=[c]);k(a,a.vnodes,u.normalizeChildren(c),b,null,void 0);a.vnodes=c;for(var d=0;d<b.length;d++)b[d]();x.activeElement!==g&&g.focus()},setEventCallback:function(a){return E=a}}}(window),M=function(a){function b(a,e){if(e instanceof Array)for(var l=0;l<e.length;l++)b(a+"["+l+"]",e[l]);else if("[object Object]"===Object.prototype.toString.call(e))for(l in e)b(a+
|
||||
"["+l+"]",e[l]);else d.push(encodeURIComponent(a)+(null!=e&&""!==e?"="+encodeURIComponent(e):""))}if("[object Object]"!==Object.prototype.toString.call(a))return"";var d=[],e;for(e in a)b(e,a[e]);return d.join("&")},N=function(a){function b(a,b){if(null==b)return a;for(var d=a.match(/:[^\/]+/gi)||[],h=0;h<d.length;h++){var e=d[h].slice(1);null!=b[e]&&(a=a.replace(d[h],b[e]),delete b[e])}return a}function d(a,b){var d=M(b);if(""!==d){var h=0>a.indexOf("?")?"?":"&";a+=h+d}return a}function e(a){try{return""!==
|
||||
a?JSON.parse(a):null}catch(b){throw Error(a);}}function k(a){return a.responseText}function q(a,b){if("function"===typeof a)if(b instanceof Array)for(var d=0;d<b.length;d++)b[d]=new a(b[d]);else return new a(b);return b}var l=0,m;return{xhr:function(g){var p=C.stream();void 0!==g.initialValue&&p(g.initialValue);var l="boolean"===typeof g.useBody?g.useBody:"GET"!==g.method&&"TRACE"!==g.method;"function"!==typeof g.serialize&&(g.serialize="undefined"!==typeof FormData&&g.data instanceof FormData?function(a){return a}:
|
||||
JSON.stringify);"function"!==typeof g.deserialize&&(g.deserialize=e);"function"!==typeof g.extract&&(g.extract=k);g.url=b(g.url,g.data);l?g.data=g.serialize(g.data):g.url=d(g.url,g.data);var h=new a.XMLHttpRequest;h.open(g.method,g.url,"boolean"===typeof g.async?g.async:!0,"string"===typeof g.user?g.user:void 0,"string"===typeof g.password?g.password:void 0);g.serialize===JSON.stringify&&l&&h.setRequestHeader("Content-Type","application/json; charset=utf-8");g.deserialize===e&&h.setRequestHeader("Accept",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue