Commit graph

1058 commits

Author SHA1 Message Date
pelonpelon
dc36588160 components.md - eliminate global variable introduced in previous commit
Oops!
2015-07-07 09:04:08 -05:00
Leo Horie
4b2ec49ca9 Merge pull request #636 from pelonpelon/patch-9
Update components.md -- "Classic MVC" example broken
2015-07-06 21:28:44 -04:00
Leo Horie
074a59791f Merge pull request #704 from pelonpelon/patch-16
Help users find documentation on unmounting components
2015-07-06 21:26:14 -04:00
pelonpelon
648343c01c Help users find documentation on unmounting components
It's a common question on Gitter: How do I unmount a component?
Presently this Google Search: `unmount site:http://lhorie.github.io/`
returns one result: `mithril.route.html` -- I have no idea why, there's no "unmount" on the page.

Adding the words unmounting and unmount to this doc page will make them discoverable directly and through Google.
2015-07-02 18:54:59 -05:00
Leo Horie
fe7d0b6c9f fix select2 example 2015-06-29 18:59:41 -04:00
Leo Horie
919f443099 simplify condition 2015-06-29 09:35:04 -04:00
Leo Horie
dbc3bc81e4 Merge pull request #692 from pelonpelon/patch-15
mithril.js: fix if clause that expects truthy value. issue: #689
2015-06-29 09:34:52 -04:00
Leo Horie
8da643c13f use bracket syntax for reserved keyword 2015-06-29 09:22:20 -04:00
pelonpelon
72b705b918 mithril.js: fix if clause that expects truthy value. issue: #689
When key=0 the if statement doesn't do what is intended.
2015-06-25 18:25:49 -05:00
Leo Horie
505d7b930d #686 prevent redraw lock on error 2015-06-23 13:43:54 -04:00
Leo Horie
04911d38a5 Merge remote-tracking branch 'origin/next' into next
Conflicts:
	mithril.js
2015-06-23 13:38:31 -04:00
Leo Horie
86a3605000 Merge pull request #685 from adamvlasak/semicolons
fixed missing semicolons
2015-06-23 13:01:36 -04:00
Leo Horie
1e0ad6c3d7 ensure we can still redraw after a promise error that gets thrown by the exception monitor 2015-06-22 18:41:53 -04:00
Adam Vlasak
fe7683fce8 fixed missing semicolons 2015-06-20 19:19:54 +02:00
Leo Horie
955f3d9571 Merge pull request #678 from venning/function
Consistency: use variable instead of literal
2015-06-19 13:21:46 -05:00
Christopher Venning
05e6088f13 Consistency: use variable instead of literal 2015-06-18 17:19:15 -04:00
Leo Horie
5cfcbfe431 Merge pull request #671 from venning/docs
Fixed typos in doc links
2015-06-17 08:08:41 -05:00
Christopher Venning
00db0b1ec0 Fixed typos in doc links 2015-06-16 16:15:42 -04:00
Leo Horie
9a315fb116 Merge pull request #666 from schisma/patch-1
(docs) fixed bower description
2015-06-15 11:47:45 -05:00
Jona H.
58d5b306fd fixed bower description
Technically, Bower isn't really a package manager for Node.js, but rather, it's made in Node and built for usage in the frontend, hence why many popular frontend libraries, such as JQuery or Bootstrap have their distributions on there. Bower also has its own package repositories.
2015-06-13 09:47:20 +02:00
Leo Horie
143b7ae3a6 Merge pull request #658 from venning/next
Change JSFiddle example to use Mithril 0.2.0
2015-06-11 15:30:55 -05:00
Christopher Venning
34fe969b61 Change JSFiddle example to use Mithril 0.2.0 2015-06-11 16:12:10 -04:00
Leo Horie
b766b255a8 Merge pull request #657 from shibukawa/patch-5
Update web-services.md
2015-06-11 12:17:48 -05:00
Leo Horie
c32b723490 Merge pull request #656 from shibukawa/patch-2
Update mithril.deferred.md
2015-06-11 12:17:36 -05:00
Yoshiki Shibukawa
47e35e32f3 Update web-services.md 2015-06-12 00:57:41 +09:00
Yoshiki Shibukawa
b911d17150 Update mithril.deferred.md 2015-06-12 00:56:03 +09:00
Leo Horie
4f7df003d1 Merge pull request #653 from venning/next
DOCS: missing comma in example
2015-06-11 09:59:58 -05:00
Leo Horie
846128a2f9 Merge pull request #654 from oampo/patch-1
Clarify order of m.route.mode and m.route
2015-06-11 09:59:46 -05:00
Joe Turner
79b127d094 Clarify order of m.route.mode and m.route
It's not completely obvious that `m.route.mode` needs setting before `m.route` is called (or at least it wasn't to me!), otherwise the initial routing from a URL typed in the location bar fails.  This PR adds a note in the documentation to make this more clear.
2015-06-11 15:28:57 +01:00
Christopher Venning
6ec6ede38a DOCS: missing comma in example 2015-06-09 19:10:51 -04:00
Leo Horie
c57b0b4047 prevent nonsensical IE error 2015-06-09 16:27:57 -05:00
Leo Horie
e6d6db6123 Merge remote-tracking branch 'origin/next' into next 2015-06-09 16:22:20 -05:00
Leo Horie
f6d436da68 prevent nonsensical IE error 2015-06-09 16:21:55 -05:00
Leo Horie
4a946b2216 Merge pull request #649 from nasitra/remove-unused-variables
Remove unused variables
2015-06-08 12:15:53 -05:00
nasitra
756cbb1924 Remove unused variables 2015-06-07 20:38:08 +09:00
Leo Horie
ff5b04c823 Merge pull request #643 from statianzo/component-first-arg
accept component as first argument to m()
2015-06-03 20:18:36 -05:00
Leo Horie
a5acb12d0c Merge pull request #644 from pelonpelon/patch-10
Minor corrections to getting-started.md
2015-06-03 20:18:09 -05:00
Leo Horie
d3343f8c30 Merge pull request #645 from pelonpelon/patch-13
community.md -- link to github wiki
2015-06-03 20:17:53 -05:00
pelonpelon
25cbdbbad5 community.md -- link to github wiki 2015-06-03 13:11:47 -05:00
Jason Staten
a406de408a Triple equals 2015-06-02 06:44:42 -06:00
pelonpelon
3883d029f2 Minor corrections to getting-started.md 2015-06-01 20:27:04 -05:00
Jason Staten
d89810234a accept component as first argument to m() 2015-06-01 15:11:44 -06:00
pelonpelon
7ce8429bf4 Update components.md -- "Classic MVC" example
@ArthurClemens pointed out in this gitter comment:
https://gitter.im/lhorie/mithril.js?at=55664ba1d21e5ed02ff06e54
that the Classic MVC example is broken:
https://lhorie.github.io/mithril/components.html#classic-mvc

I wanted to show a working jsfiddle with these changes applied, but I couldn't figure out how to get a POST request working. I do, however, have a jsbin that is working, although there are significant changes in the code to allow for GET and POST.
http://jsbin.com/cokesu/2/edit?js,output

A redraw is called for every character entered in the jsbin but AFAICT, not in this PR. I don't know why. It's as though `oninput` is really `onchange`. It's possible to limit the redraw to once when the "save" button is clicked, but this requires a change in logic:

var ContactForm = {
    controller: function(args) {
        this.contact = m.prop(new Contact())
        this.save = function(contact) {
           Observable.trigger("saveContact", {contact: contact})
        }
    },
    view: function(ctrl, args) {
        var contact = ctrl.contact()

        return m("form", [
            m("label", "Name"),
            m("input[name=name]"),

            m("label", "Email"),
            m("input[name=email]"),

            m("button[type=button]", {onclick: function(){
              contact = {
                name: m.prop(this.parentNode.elements.name.value),
                email: m.prop(this.parentNode.elements.email.value)
              }
              ctrl.save(contact)
            
            }}, "Save")
        ])
    }
}
2015-05-28 03:47:40 -05:00
Leo Horie
26a6664cd0 Merge pull request #613 from bemurphy/bem-fix_component_example
Fix conversion in component stateless example
2015-05-11 10:23:35 -04:00
Brendon Murphy
7288afc18e Fix conversion in component stateless example 2015-05-08 20:16:12 -07:00
Leo Horie
0ec4ed451f Merge remote-tracking branch 'origin/next' into next 2015-05-07 20:46:37 -04:00
Leo Horie
390bf49e8c Merge pull request #610 from fuzetsu/next
components.md 'trigger', not 'broadcast'
2015-05-07 16:40:34 -04:00
Daniel Loomer
c622283877 components.md 'trigger', not 'broadcast' 2015-05-07 15:54:51 -04:00
Leo Horie
d4ccb09041 Merge pull request #609 from pelonpelon/patch-3
Clarification on m.mount() signature
2015-05-07 10:25:37 -04:00
pelonpelon
592f31ee3d Clarification on m.mount() signature 2015-05-07 08:51:36 -05:00