From 8a7f2f85d75f0e86d4e33c0cc0bcc072f046a2b0 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Gerardy Date: Tue, 4 Apr 2017 12:43:44 +0200 Subject: [PATCH] v1.1.1 --- mithril.js | 8 ++++---- mithril.min.js | 10 +++++----- package.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mithril.js b/mithril.js index eb0510da..1b1a7b0a 100644 --- a/mithril.js +++ b/mithril.js @@ -42,8 +42,8 @@ function execSelector(state, attrs, children) { attrs[key] = state.attrs[key] } } - if (className != null) { - if (attrs.class != null) { + if (className !== undefined) { + if (attrs.class !== undefined) { attrs.class = undefined attrs.className = className } @@ -73,7 +73,7 @@ function hyperscript(selector) { if (typeof selector === "string") { var cached = selectorCache[selector] || compileSelector(selector) } - if (!attrs) { + if (attrs == null) { attrs = {} } else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) { attrs = {} @@ -1220,7 +1220,7 @@ m.request = requestService.request m.jsonp = requestService.jsonp m.parseQueryString = parseQueryString m.buildQueryString = buildQueryString -m.version = "1.1.0" +m.version = "1.1.1" m.vnode = Vnode if (typeof module !== "undefined") module["exports"] = m else window.m = m diff --git a/mithril.min.js b/mithril.min.js index b6cbc043..1a5bb54a 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -1,8 +1,8 @@ (function(){function B(b,d,f,g,e,n){return{tag:b,key:d,attrs:f,children:g,text:e,dom:n,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}function C(b){var d=arguments[1],f=2,g;if(null==b||"string"!==typeof b&&"function"!==typeof b&&"function"!==typeof b.view)throw Error("The selector must be either a string or a component.");if("string"===typeof b){var e;if(!(e=M[b])){g="div";for(var n=[],k={};e=P.exec(b);){var q=e[1],m=e[2];""===q&&""!==m?g=m:"#"===q?k.id=m:"."===q? -n.push(m):"["===e[3][0]&&((q=e[6])&&(q=q.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===e[4]?n.push(q):k[e[4]]=q||!0)}0