Merge remote-tracking branch 'origin/next' into next

This commit is contained in:
Leo 2017-02-19 08:27:48 -05:00
commit 271ef96fef
2 changed files with 6 additions and 6 deletions

View file

@ -790,11 +790,11 @@ var coreRenderer = function($window) {
else if (key2 === "style") updateStyle(element, old, value)
else if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {
//setting input[value] to same value by typing on focused element moves cursor to end in Chrome
if (vnode.tag === "input" && key2 === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return
if (vnode.tag === "input" && key2 === "value" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return
//setting select[value] to same value while having select open blinks select dropdown in Chrome
if (vnode.tag === "select" && key2 === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return
if (vnode.tag === "select" && key2 === "value" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return
//setting option[value] to same value while having select open blinks select dropdown in Chrome
if (vnode.tag === "option" && key2 === "value" && vnode.dom.value === value) return
if (vnode.tag === "option" && key2 === "value" && vnode.dom.value == value) return
element[key2] = value
}
else {

6
mithril.min.js vendored
View file

@ -28,9 +28,9 @@ a.domSize;if(null!=b||null==a.dom){var c=p.createDocumentFragment();if(0<b){for(
b.length)throw Error("Child node of a contenteditable must be trusted");}function x(a,b,e,d){for(;b<e;b++){var q=a[b];null!=q&&(q.skip?q.skip=!1:c(q,d))}}function c(a,b){function c(){if(++q===d&&(A(a),a.dom)){var c=a.domSize||1;if(1<c)for(var e=a.dom;--c;){var f=e.nextSibling,g=f.parentNode;null!=g&&g.removeChild(f)}c=a.dom;e=c.parentNode;null!=e&&e.removeChild(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])}}var d=1,q=0;if(a.attrs&&a.attrs.onbeforeremove){var f=a.attrs.onbeforeremove.call(a.state,a);null!=f&&"function"===typeof f.then&&(d++,f.then(c,c))}"string"!==typeof a.tag&&a.state.onbeforeremove&&(f=a.state.onbeforeremove(a),null!=f&&"function"===typeof f.then&&(d++,f.then(c,c)));c()}function A(a){a.attrs&&a.attrs.onremove&&a.attrs.onremove.call(a.state,a);if("string"!==typeof a.tag&&a.state.onremove)a.state.onremove(a);if(null!=a.instance)A(a.instance);else if(a=
a.children,Array.isArray(a))for(var b=0;b<a.length;b++){var c=a[b];null!=c&&A(c)}}function y(a,b,c,d,f){var e=a.dom;if("key"!==b&&"is"!==b&&(c!==d||"value"===b||"checked"===b||"selectedIndex"===b||"selected"===b&&a.dom===p.activeElement||"object"===typeof d)&&"undefined"!==typeof d&&!D(b)){var g=b.indexOf(":");if(-1<g&&"xlink"===b.substr(0,g))e.setAttributeNS("http://www.w3.org/1999/xlink",b.slice(g+1),d);else if("o"===b[0]&&"n"===b[1]&&"function"===typeof d)M(a,b,d);else if("style"===b)if(a=c,a===
d&&(e.style.cssText="",a=null),null==d)e.style.cssText="";else if("string"===typeof d)e.style.cssText=d;else{"string"===typeof a&&(e.style.cssText="");for(var q in d)e.style[q]=d[q];if(null!=a&&"string"!==typeof a)for(q in a)q in d||(e.style[q]="")}else b in e&&"href"!==b&&"list"!==b&&"form"!==b&&"width"!==b&&"height"!==b&&void 0===f&&!(a.attrs.is||-1<a.tag.indexOf("-"))?"input"===a.tag&&"value"===b&&a.dom.value===d&&a.dom===p.activeElement||"select"===a.tag&&"value"===b&&a.dom.value===d&&a.dom===
p.activeElement||"option"===a.tag&&"value"===b&&a.dom.value===d||(e[b]=d):"boolean"===typeof d?d?e.setAttribute(b,""):e.removeAttribute(b):e.setAttribute("className"===b?"class":b,d)}}function D(a){return"oninit"===a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function M(a,b,c){var d=a.dom,e="function"!==typeof I?c:function(a){var b=c.call(d,a);I.call(d,a);return b};if(b in d)d[b]="function"===typeof c?e:null;else{var f=b.slice(2);void 0===a.events&&
(a.events={});a.events[b]!==e&&(null!=a.events[b]&&d.removeEventListener(f,a.events[b],!1),"function"===typeof c&&(a.events[b]=e,d.addEventListener(f,a.events[b],!1)))}}function v(a,b,c){"function"===typeof a.oninit&&a.oninit.call(b.state,b);"function"===typeof a.oncreate&&c.push(a.oncreate.bind(b.state,b))}function z(a,b,c,d){d?v(a,b,c):"function"===typeof a.onupdate&&c.push(a.onupdate.bind(b.state,b))}var p=a.document,J=p.createDocumentFragment(),I;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.style.cssText="",a=null),null==d)e.style.cssText="";else if("string"===typeof d)e.style.cssText=d;else{"string"===typeof a&&(e.style.cssText="");for(var q in d)e.style[q]=d[q];if(null!=a&&"string"!==typeof a)for(q in a)q in d||(e.style[q]="")}else b in e&&"href"!==b&&"list"!==b&&"form"!==b&&"width"!==b&&"height"!==b&&void 0===f&&!(a.attrs.is||-1<a.tag.indexOf("-"))?"input"===a.tag&&"value"===b&&a.dom.value==d&&a.dom===p.activeElement||"select"===a.tag&&"value"===b&&a.dom.value==d&&a.dom===p.activeElement||
"option"===a.tag&&"value"===b&&a.dom.value==d||(e[b]=d):"boolean"===typeof d?d?e.setAttribute(b,""):e.removeAttribute(b):e.setAttribute("className"===b?"class":b,d)}}function D(a){return"oninit"===a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function M(a,b,c){var d=a.dom,e="function"!==typeof I?c:function(a){var b=c.call(d,a);I.call(d,a);return b};if(b in d)d[b]="function"===typeof c?e:null;else{var f=b.slice(2);void 0===a.events&&(a.events={});a.events[b]!==
e&&(null!=a.events[b]&&d.removeEventListener(f,a.events[b],!1),"function"===typeof c&&(a.events[b]=e,d.addEventListener(f,a.events[b],!1)))}}function v(a,b,c){"function"===typeof a.oninit&&a.oninit.call(b.state,b);"function"===typeof a.oncreate&&c.push(a.oncreate.bind(b.state,b))}function z(a,b,c,d){d?v(a,b,c):"function"===typeof a.onupdate&&c.push(a.onupdate.bind(b.state,b))}var p=a.document,J=p.createDocumentFragment(),I;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=p.activeElement;null==a.vnodes&&(a.textContent="");Array.isArray(b)||(b=[b]);g(a,a.vnodes,w.normalizeChildren(b),!1,c,null,void 0);a.vnodes=b;for(var f=0;f<c.length;f++)c[f]();p.activeElement!==d&&d.focus()},setEventCallback:function(a){return I=a}}},G=function(a){function d(a){a=f.indexOf(a);-1<a&&f.splice(a,2)}function h(){for(var a=1;a<f.length;a+=2)f[a]()}a=N(a);a.setEventCallback(function(a){!1!==a.redraw&&h()});var f=[];return{subscribe:function(a,h){d(a);f.push(a,P(h))},unsubscribe:d,
redraw:h,render:a.render}}(window);K.setCompletionCallback(G.redraw);z.mount=function(a){return function(d,h){if(null===h)a.render(d,[]),a.unsubscribe(d);else{if(null==h.view&&"function"!==typeof h)throw Error("m.mount(element, component) expects a component, not a vnode");a.subscribe(d,function(){a.render(d,w(h))});a.redraw()}}}(G);var R=v,L=function(a){if(""===a||null==a)return{};"?"===a.charAt(0)&&(a=a.slice(1));a=a.split("&");for(var d={},h={},f=0;f<a.length;f++){var g=a[f].split("="),l=decodeURIComponent(g[0]),
g=2===g.length?decodeURIComponent(g[1]):"";"true"===g?g=!0:"false"===g&&(g=!1);var k=l.split(/\]\[?|\[/),m=d;-1<l.indexOf("[")&&k.pop();for(var n=0;n<k.length;n++){var l=k[n],t=k[n+1],t=""==t||!isNaN(parseInt(t,10)),x=n===k.length-1;""===l&&(l=k.slice(0,n).join(),null==h[l]&&(h[l]=0),l=h[l]++);null==m[l]&&(m[l]=x?g:t?[]:{});m=m[l]}}return d},S=function(a){function d(d){var f=a.location[d].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);"pathname"===d&&"/"!==f[0]&&(f="/"+f);return f}function h(a){return function(){null==