Commit graph

559 commits

Author SHA1 Message Date
darda
c17ea5bbc8 Push route to history stack, when using parameters
Bugfix for issue #1124
The condition has been changed, which is deciding to push the a route to history stack.
I think, it is necessary to compare the old route with the current route, instead of old route with root (without parameters).
2016-07-06 16:00:39 +02:00
Jared Jacobs
e9e2a45caa Fixing m.route() after a canceled navigation (#1126) 2016-06-29 22:48:45 -07:00
1111hui
2c3d3e5df0 cleanup and apply editorconfig 2016-06-20 16:15:59 +08:00
1111hui
8550501fb2 FIX: ES3 props keyword bug in IE8; eslint errors 2016-06-20 15:41:50 +08:00
Demian Ferreiro
3e51c8c2ff Remove unloaders when root element is removed
When a controller calls preventDefault on its onunload method, it prevents the current root element from being unmounted via a route change. But it does not prevent it from being unmounted via m.mount(root, null). In that case, the root element is unmounted, but any unloaders that it had keep hanging on the `unloaders` array, and that prevented any future m.mount(root, component) calls from succeeding. This is what was happening on the pending route() tests.

The fix is pretty simple: just reset the `unloaders` array when removing the root element, just like it's done when no unloader calls preventDefault.

Also, 2 of the 4 pending tests were removed because they were identical to the other 2.
2016-06-18 07:41:49 -03:00
Demian Ferreiro
f3dd4fce7d Fix #1091 set correct select value when options change
Always consider the edge case of setting a <select> value when building an object. When a <select> node is reused, its option children can change, so its value attribute has to be re-assigned after its children have been recreated/updated.
2016-06-13 03:55:57 -03:00
Bruce Lewis
c98f663653 Render booleans as empty strings 2016-06-10 11:00:56 -04:00
Leo Horie
3cf16631a0 fix valueless attributes #1093 2016-06-06 09:21:58 -04:00
Leo Horie
474c43e433 update style if it's mutated object 2016-06-02 18:47:41 -04:00
Leo Horie
80349b3c74 #1080 parse pattern attribute correctly 2016-06-01 15:42:08 -04:00
Leo Horie
b128fd8232 don't shortcircuit promise check for objects 2016-05-26 11:45:48 -04:00
Leo Horie
ce748f9f71 check for existence of Promise before doing check against it 2016-05-26 11:30:27 -04:00
Leo Horie
0ad6749f87 callbackName 2016-05-26 11:19:39 -04:00
Leo Horie
bdd65b3b86 Merge remote-tracking branch 'origin/next' into next 2016-05-26 11:04:51 -04:00
Leo Horie
bf85b7a530 #1076 absorb native promise in m.prop 2016-05-26 11:04:04 -04:00
Ian Henderson
1673579d32 Add replaceScriptNodes function 2016-05-19 09:53:09 -07:00
Leo Horie
d19ce8e598 Merge remote-tracking branch 'origin/next' into next 2016-05-13 06:55:44 -04:00
Leo Horie
a7496a1ef7 Merge branch 'spike' of https://github.com/mtwtkman/mithril.js into mtwtkman-spike
Conflicts:
	mithril.min.js
	mithril.min.js.map
2016-05-13 06:54:51 -04:00
Leo Horie
0c19bf72ee Merge pull request #1037 from omakasecorp/next
Force redirect when pushState encounters an error
2016-05-11 11:53:36 -04:00
Leo Horie
dee64503db #1039 ignore url interpolations without mapped values 2016-05-06 11:49:00 -04:00
Leo Horie
db17958f0b #691 sync input if user-set DOM value 2016-05-05 13:12:36 -04:00
Adam Gschwender
6face740f5 Force redirect when pushState encounters an error
Version 9.1 of Safari allows a maximum of 100 calls to pushState.
Subsequent calls to pushState throw a SecurityError: DOM Exception 18:
An attempt was made to break through the security policy of the user
agent.
2016-05-04 20:25:35 -04:00
mtwtkman
af0a63f850 Bump to v0.2.4 for m.version 2016-04-26 20:58:20 +09:00
Gyandeep Singh
d451def561 Update: Big Perf improvement for IE (fixes #199) 2016-04-20 13:44:15 -05:00
Leo Horie
f226d56481 Merge remote-tracking branch 'origin/next' into next 2016-04-20 00:36:48 -04:00
Leo Horie
da586de7dc don't swallow runtime errors in request 2016-04-20 00:35:53 -04:00
robinchew
4308b182ca Traceur Support
traceur --script mithril-v0.2.3.js code-that-calls-m.js
2016-04-15 03:10:50 +08:00
Leo Horie
cb966d9088 don't throw reference error if event is synthetic and forgets to pass e arg 2016-04-13 15:32:58 -04:00
impinball
a07483a164 Actually lint core, regenerate minified files 2016-03-28 07:54:26 -04:00
Isiah Meadows
8f348435e4 Merge pull request #1002 from isiahmeadows/arg-fix
Serialize arguments correctly in m.component
2016-03-28 06:37:17 -04:00
impinball
07244b1999 Serialize arguments correctly in m.component 2016-03-28 06:28:51 -04:00
yuyang
82d65b076a change new Array => [] 2016-03-25 12:47:03 +08:00
Leo Horie
fcf6e16929 Merge pull request #975 from barneycarroll/empty-attrs-string
Empty attributes. Fixes #971
2016-03-19 22:36:32 -04:00
Isiah Meadows
806e0a8dc1 Merge pull request #973 from isiahmeadows/lint
Make linter happy with mithril.js
2016-03-17 23:56:13 -04:00
Leo Horie
64d1ce1d7d Merge branch 'next' of github.com:lhorie/mithril.js into next 2016-03-16 01:07:07 -04:00
Leo Horie
96bf37588b trailing semi-colon 2016-03-16 01:06:35 -04:00
Pat Cavit
eac505aead Use for-loop to map arguments instead of slice
http://jsperf.com/arguments-slice-vs-for-loop-copy
2016-03-09 14:33:52 -08:00
Barney Carroll
10f30dfa2e Remove redundant logic as per @niothiel's tip 2016-03-03 15:26:09 +00:00
Carroll
ea946f1a0e Empty attributes. Fixes #971 2016-03-03 10:27:26 +00:00
impinball
9d02042d78 Make linter happy with Mithril.js 2016-03-02 16:27:08 -05:00
Leo Horie
79665d46f4 fix version string 2016-03-02 16:16:33 -05:00
Leo Horie
3aa3545236 Merge branch 'next' of github.com:lhorie/mithril.js into next 2016-02-25 20:27:06 -05:00
Leo Horie
58ef29e8d5 #931 prevent unloaders from being registered more than once 2016-02-25 20:27:01 -05:00
mar
3f09713583 Use object lookup instead of long condition chain 2016-02-18 19:55:37 +00:00
mar
01ff1a36fd Use object lookup instead of long RegExp
Should be faster.
2016-02-18 19:47:38 +00:00
mar
3e4af6ff22 Use Array#slice to convert arguments to Array 2016-02-18 19:16:32 +00:00
mar
74062cda29 Parameterize URLs with a single String#replace 2016-02-18 18:53:45 +00:00
Már Örlygsson
7a184cb3b7 Use RegExp#test instead of String#match
Using `.test()` is both faster and more explicit.
2016-02-18 18:44:16 +00:00
Leo Horie
0682932f63 remove is attribute regular element creation 2016-01-29 16:27:09 -05:00
Leo Horie
4f0d479ee7 Merge branch 'lint' of https://github.com/isiahmeadows/mithril.js into isiahmeadows-lint
Conflicts:
	mithril.js
	tests/mithril-tests.js
2016-01-28 18:40:19 -05:00