Bundled output for commit 1ad9f84bb4 [skip ci]

This commit is contained in:
Gandalf-the-Bot 2017-12-09 00:47:03 +00:00
parent 1ad9f84bb4
commit 77f1c81eb5
2 changed files with 6 additions and 6 deletions

View file

@ -1056,7 +1056,7 @@ var coreRenderer = function($window) {
}
}
function isFormAttribute(vnode, attr) {
return attr === "value" || attr === "checked" || attr === "selectedIndex" || attr === "selected" && vnode.dom === $doc.activeElement || vnode.dom.parentNode === $doc.activeElement
return attr === "value" || attr === "checked" || attr === "selectedIndex" || attr === "selected" && vnode.dom === $doc.activeElement || vnode.tag === "option" && vnode.dom.parentNode === $doc.activeElement
}
function isLifecycleMethod(attr) {
return attr === "oninit" || attr === "oncreate" || attr === "onupdate" || attr === "onremove" || attr === "onbeforeremove" || attr === "onbeforeupdate"

10
mithril.min.js vendored
View file

@ -29,11 +29,11 @@ f,a)}null!=f.instance?(null==b.instance?p(g,f.instance,a,h,c):r(g,b.instance,f.i
g[b]&&null!=g[b].dom)return g[b].dom;return c}function c(g,b,a){a?g.insertBefore(b,a):g.appendChild(b)}function C(g){var b=g.children;if(null!=b&&1===b.length&&"<"===b[0].tag)b=b[0].children,g.dom.innerHTML!==b&&(g.dom.innerHTML=b);else if(null!=g.text||null!=b&&0!==b.length)throw Error("Child node of a contenteditable must be trusted");}function A(g,b,a,c,d){for(;b<a;b++){var f=g[b];null!=f&&(f.skip?f.skip=!1:y(f,c,d))}}function y(a,b,c){function g(){if(++h===f&&(c||(d(a,r),x(a)),a.dom)){var g=a.domSize||
1;if(1<g)for(var e=a.dom;--g;){var n=e.nextSibling,k=n.parentNode;null!=k&&k.removeChild(n)}g=a.dom;e=g.parentNode;null!=e&&e.removeChild(g);B(a,b)}}var f=1,h=0;if(!c){var r=a.state;if(a.attrs&&"function"===typeof a.attrs.onbeforeremove){var k=e.call(a.attrs.onbeforeremove,a);null!=k&&"function"===typeof k.then&&(f++,k.then(g,g))}"string"!==typeof a.tag&&"function"===typeof a.state.onbeforeremove&&(k=e.call(a.state.onbeforeremove,a),null!=k&&"function"===typeof k.then&&(f++,k.then(g,g)))}g()}function B(a,
b){var c;if(c=null!=b&&null==a.domSize)c=a.attrs,c=!(null!=c&&(c.oncreate||c.onupdate||c.onbeforeremove||c.onremove));c&&"string"===typeof a.tag&&(b.pool?b.pool.push(a):b.pool=[a])}function x(a){a.attrs&&"function"===typeof a.attrs.onremove&&e.call(a.attrs.onremove,a);if("string"!==typeof a.tag)"function"===typeof a.state.onremove&&e.call(a.state.onremove,a),null!=a.instance&&x(a.instance);else if(a=a.children,Array.isArray(a))for(var b=0;b<a.length;b++){var c=a[b];null!=c&&x(c)}}function J(a,b,c,
d,e){if("key"!==b&&"is"!==b&&!S(b)){if("o"===b[0]&&"n"===b[1])return T(a,b,d);if((c!==d||"value"===b||"checked"===b||"selectedIndex"===b||"selected"===b&&a.dom===D.activeElement||a.dom.parentNode===D.activeElement||"object"===typeof d)&&void 0!==d){var f=a.dom;if("xlink:"===b.slice(0,6))f.setAttributeNS("http://www.w3.org/1999/xlink",b,d);else if("style"===b)if(a=c,null!=a&&null!=d&&"object"===typeof a&&"object"===typeof d&&d!==a){for(var g in d)d[g]!==a[g]&&(f.style[g]=d[g]);for(g in a)g in d||(f.style[g]=
"")}else if(a===d&&(f.style.cssText="",a=null),null==d)f.style.cssText="";else if("string"===typeof d)f.style.cssText=d;else for(g in"string"===typeof a&&(f.style.cssText=""),d)f.style[g]=d[g];else if(b in f&&"href"!==b&&"list"!==b&&"form"!==b&&"width"!==b&&"height"!==b&&void 0===e&&!(a.attrs.is||-1<a.tag.indexOf("-"))){if("value"===b){g=""+d;if(("input"===a.tag||"textarea"===a.tag)&&a.dom.value===g&&a.dom===D.activeElement)return;if("select"===a.tag)if(null===d){if(-1===a.dom.selectedIndex&&a.dom===
D.activeElement)return}else if(null!==c&&a.dom.value===g&&a.dom===D.activeElement)return;if("option"===a.tag&&null!=c&&a.dom.value===g)return}"input"===a.tag&&"type"===b?f.setAttribute(b,d):f[b]=d}else"boolean"===typeof d?d?f.setAttribute(b,""):f.removeAttribute(b):f.setAttribute("className"===b?"class":b,d)}}}function S(a){return"oninit"===a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function N(){}function T(a,b,c){null!=a.events?a.events[b]!==c&&
(null==c||"function"!==typeof c&&"object"!==typeof c?(null!=a.events[b]&&a.dom.removeEventListener(b.slice(2),a.events,!1),a.events[b]=void 0):(null==a.events[b]&&a.dom.addEventListener(b.slice(2),a.events,!1),a.events[b]=c)):null==c||"function"!==typeof c&&"object"!==typeof c||(a.events=new N,a.dom.addEventListener(b.slice(2),a.events,!1),a.events[b]=c)}function K(a,b,c){"function"===typeof a.oninit&&e.call(a.oninit,b);"function"===typeof a.oncreate&&c.push(e.bind(a.oncreate,b))}function M(a,b,c){"function"===
typeof a.onupdate&&c.push(e.bind(a.onupdate,b))}var D=a.document,H=D.createDocumentFragment(),G={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},F;N.prototype=Object.create(null);N.prototype.handleEvent=function(a){var b=this["on"+a.type];"function"===typeof b?b.call(a.target,a):"function"===typeof b.handleEvent&&b.handleEvent(a);"function"===typeof F&&F.call(a.target,a)};return{render:function(a,b){if(!a)throw Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");
d,e){if("key"!==b&&"is"!==b&&!S(b)){if("o"===b[0]&&"n"===b[1])return T(a,b,d);if((c!==d||"value"===b||"checked"===b||"selectedIndex"===b||"selected"===b&&a.dom===D.activeElement||"option"===a.tag&&a.dom.parentNode===D.activeElement||"object"===typeof d)&&void 0!==d){var f=a.dom;if("xlink:"===b.slice(0,6))f.setAttributeNS("http://www.w3.org/1999/xlink",b,d);else if("style"===b)if(a=c,null!=a&&null!=d&&"object"===typeof a&&"object"===typeof d&&d!==a){for(var g in d)d[g]!==a[g]&&(f.style[g]=d[g]);for(g in a)g in
d||(f.style[g]="")}else if(a===d&&(f.style.cssText="",a=null),null==d)f.style.cssText="";else if("string"===typeof d)f.style.cssText=d;else for(g in"string"===typeof a&&(f.style.cssText=""),d)f.style[g]=d[g];else if(b in f&&"href"!==b&&"list"!==b&&"form"!==b&&"width"!==b&&"height"!==b&&void 0===e&&!(a.attrs.is||-1<a.tag.indexOf("-"))){if("value"===b){g=""+d;if(("input"===a.tag||"textarea"===a.tag)&&a.dom.value===g&&a.dom===D.activeElement)return;if("select"===a.tag)if(null===d){if(-1===a.dom.selectedIndex&&
a.dom===D.activeElement)return}else if(null!==c&&a.dom.value===g&&a.dom===D.activeElement)return;if("option"===a.tag&&null!=c&&a.dom.value===g)return}"input"===a.tag&&"type"===b?f.setAttribute(b,d):f[b]=d}else"boolean"===typeof d?d?f.setAttribute(b,""):f.removeAttribute(b):f.setAttribute("className"===b?"class":b,d)}}}function S(a){return"oninit"===a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function N(){}function T(a,b,c){null!=a.events?a.events[b]!==
c&&(null==c||"function"!==typeof c&&"object"!==typeof c?(null!=a.events[b]&&a.dom.removeEventListener(b.slice(2),a.events,!1),a.events[b]=void 0):(null==a.events[b]&&a.dom.addEventListener(b.slice(2),a.events,!1),a.events[b]=c)):null==c||"function"!==typeof c&&"object"!==typeof c||(a.events=new N,a.dom.addEventListener(b.slice(2),a.events,!1),a.events[b]=c)}function K(a,b,c){"function"===typeof a.oninit&&e.call(a.oninit,b);"function"===typeof a.oncreate&&c.push(e.bind(a.oncreate,b))}function M(a,
b,c){"function"===typeof a.onupdate&&c.push(e.bind(a.onupdate,b))}var D=a.document,H=D.createDocumentFragment(),G={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},F;N.prototype=Object.create(null);N.prototype.handleEvent=function(a){var b=this["on"+a.type];"function"===typeof b?b.call(a.target,a):"function"===typeof b.handleEvent&&b.handleEvent(a);"function"===typeof F&&F.call(a.target,a)};return{render:function(a,b){if(!a)throw Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");
var c=[],d=D.activeElement,e=a.namespaceURI;null==a.vnodes&&(a.textContent="");Array.isArray(b)||(b=[b]);q(a,a.vnodes,t.normalizeChildren(b),!1,c,null,"http://www.w3.org/1999/xhtml"===e?void 0:e);a.vnodes=b;null!=d&&D.activeElement!==d&&d.focus();for(d=0;d<c.length;d++)c[d]()},setEventCallback:function(a){return F=a}}},L=function(a,d){function e(a){a=l.indexOf(a);-1<a&&l.splice(a,2)}function h(){if(k)throw Error("Nested m.redraw.sync() call");k=!0;for(var a=1;a<l.length;a+=2)try{l[a]()}catch(m){"undefined"!==
typeof console&&console.error(m)}k=!1}var p=U(a);p.setEventCallback(function(a){!1===a.redraw?a.redraw=void 0:q()});var l=[],k=!1,q=(d||W)(h);q.sync=h;return{subscribe:function(a,d){e(a);l.push(a,d)},unsubscribe:e,redraw:q,render:p.render}}(window);O.setCompletionCallback(L.redraw);x.mount=function(a){return function(d,e){if(null===e)a.render(d,[]),a.unsubscribe(d);else{if(null==e.view&&"function"!==typeof e)throw Error("m.mount(element, component) expects a component, not a vnode");var h=function(){a.render(d,
t(e))};a.subscribe(d,h);h()}}}(L);var aa=B,P=function(a){if(""===a||null==a)return{};"?"===a.charAt(0)&&(a=a.slice(1));a=a.split("&");for(var d={},e={},h=0;h<a.length;h++){var p=a[h].split("="),l=decodeURIComponent(p[0]);p=2===p.length?decodeURIComponent(p[1]):"";"true"===p?p=!0:"false"===p&&(p=!1);var k=l.split(/\]\[?|\[/),q=d;-1<l.indexOf("[")&&k.pop();for(var r=0;r<k.length;r++){l=k[r];var m=k[r+1];m=""==m||!isNaN(parseInt(m,10));var u=r===k.length-1;""===l&&(l=k.slice(0,r).join(),null==e[l]&&