v2.0.0-rc.9
This commit is contained in:
parent
c30a716e49
commit
ae6b547673
5 changed files with 18 additions and 15 deletions
|
|
@ -18,7 +18,7 @@ mithril.js [](https://ww
|
||||||
|
|
||||||
## What is Mithril?
|
## What is Mithril?
|
||||||
|
|
||||||
A modern client-side Javascript framework for building Single Page Applications. It's small (<!-- size -->9.53 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.
|
A modern client-side Javascript framework for building Single Page Applications. It's small (<!-- size -->9.55 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.
|
||||||
|
|
||||||
Mithril is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.
|
Mithril is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.
|
||||||
|
|
||||||
|
|
|
||||||
17
mithril.js
17
mithril.js
|
|
@ -1675,17 +1675,19 @@ var _25 = function($window, mountRedraw00) {
|
||||||
// Remove these so they don't get overwritten
|
// Remove these so they don't get overwritten
|
||||||
var attrs3 = {}, onclick, href
|
var attrs3 = {}, onclick, href
|
||||||
assign(attrs3, vnode5.attrs)
|
assign(attrs3, vnode5.attrs)
|
||||||
attrs3.component = null
|
// The first two are internal, but the rest are magic attributes
|
||||||
attrs3.options = null
|
// that need censored to not screw up rendering0.
|
||||||
attrs3.key = null
|
attrs3.selector = attrs3.options = attrs3.key = attrs3.oninit =
|
||||||
|
attrs3.oncreate = attrs3.onbeforeupdate = attrs3.onupdate =
|
||||||
|
attrs3.onbeforeremove = attrs3.onremove = null
|
||||||
// Do this now so we can get the most current `href` and `disabled`.
|
// Do this now so we can get the most current `href` and `disabled`.
|
||||||
// Those attributes may also be specified in the selector, and we
|
// Those attributes may also be specified in the selector, and we
|
||||||
// should honor that.
|
// should honor that.
|
||||||
var child0 = m3(vnode5.attrs.component || "a", attrs3, vnode5.children)
|
var child0 = m3(vnode5.attrs.selector || "a", attrs3, vnode5.children)
|
||||||
// Let's provide a *right* way to disable a route link, rather than
|
// Let's provide a *right* way to disable a route link, rather than
|
||||||
// letting people screw up accessibility on accident.
|
// letting people screw up accessibility on accident.
|
||||||
//
|
//
|
||||||
// The attribute is coerced so users don't get surprised over
|
// The attribute is1 coerced so users don't get surprised over
|
||||||
// `disabled: 0` resulting in a button that's somehow routable
|
// `disabled: 0` resulting in a button that's somehow routable
|
||||||
// despite being visibly disabled.
|
// despite being visibly disabled.
|
||||||
if (child0.attrs.disabled = Boolean(child0.attrs.disabled)) {
|
if (child0.attrs.disabled = Boolean(child0.attrs.disabled)) {
|
||||||
|
|
@ -1718,19 +1720,20 @@ var _25 = function($window, mountRedraw00) {
|
||||||
// link target, etc. Nope, this isn't just for blind people.
|
// link target, etc. Nope, this isn't just for blind people.
|
||||||
if (
|
if (
|
||||||
// Skip if `onclick` prevented default
|
// Skip if `onclick` prevented default
|
||||||
result1 === false || !e.defaultPrevented &&
|
result1 !== false && !e.defaultPrevented &&
|
||||||
// Ignore everything but left clicks
|
// Ignore everything but left clicks
|
||||||
(e.button === 0 || e.which === 0 || e.which === 1) &&
|
(e.button === 0 || e.which === 0 || e.which === 1) &&
|
||||||
// Let the browser handle1 `target=_blank`, etc.
|
// Let the browser handle1 `target=_blank`, etc.
|
||||||
(!e.currentTarget.target || e.currentTarget.target === "_self") &&
|
(!e.currentTarget.target || e.currentTarget.target === "_self") &&
|
||||||
// No modifier keys
|
// No modifier keys
|
||||||
!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey
|
!e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey
|
||||||
) return
|
) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.redraw = false
|
e.redraw = false
|
||||||
route.set(href, null, options)
|
route.set(href, null, options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return child0
|
return child0
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
mithril.min.js
vendored
2
mithril.min.js
vendored
File diff suppressed because one or more lines are too long
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mithril",
|
"name": "mithril",
|
||||||
"version": "2.0.0-rc.8",
|
"version": "2.0.0-rc.9",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mithril",
|
"name": "mithril",
|
||||||
"version": "2.0.0-rc.8",
|
"version": "2.0.0-rc.9",
|
||||||
"description": "A framework for building brilliant applications",
|
"description": "A framework for building brilliant applications",
|
||||||
"author": "Leo Horie",
|
"author": "Leo Horie",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue