Skip to content

Commit

Permalink
Make 1.0 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
paxjs committed Dec 21, 2016
1 parent 42ffd99 commit 0d1d553
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Expand Up @@ -63,6 +63,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');

grunt.registerTask('test', ['jshint', 'qunit']);
grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify']);
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
grunt.registerTask('justbuild', ['concat', 'uglify']);
};
};
13 changes: 6 additions & 7 deletions dist/mithril.bindings.js
Expand Up @@ -65,8 +65,7 @@ var mithrilBindings = function(m){
// You can use .delay(true) to be able to manually handle updates
prop.subscribe(function(val){
if(!delay) {
m.startComputation();
m.endComputation();
m.redraw();
}
return prop;
});
Expand All @@ -75,9 +74,9 @@ var mithrilBindings = function(m){
};

// Element function that applies our extended bindings
// Note:
// Note:
// . Some attributes can be removed when applied, eg: custom attributes
//
//
m.e = function(element, attrs, children) {
for (var name in attrs) {
if (m.bindings[name]) {
Expand Down Expand Up @@ -170,7 +169,7 @@ var mithrilBindings = function(m){
}
}, true );

// Add value bindings for various event types
// Add value bindings for various event types
var events = ["Input", "Keyup", "Keypress"],
createBinding = function(name, eve){
// Bi-directional binding of value
Expand All @@ -197,7 +196,7 @@ var mithrilBindings = function(m){
};
};

/* Returns a function that can trigger a binding
/* Returns a function that can trigger a binding
Usage: onclick: m.trigger('binding', prop)
*/
m.trigger = function(){
Expand All @@ -224,4 +223,4 @@ if (typeof module != "undefined" && module !== null && module.exports) {
mithrilBindings(typeof window != "undefined"? window.m || {}: {});
}

}());
}());
4 changes: 2 additions & 2 deletions dist/mithril.bindings.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "mithril.bindings",
"version": "0.0.4",
"version": "0.0.5",
"description": "Mithril bindings - bi-directional bindings and richer properties with subscribeability.",
"repository": {
"type": "git",
Expand All @@ -17,4 +17,4 @@
},
"main": "dist/mithril.bindings.js",
"license": "MIT"
}
}
13 changes: 6 additions & 7 deletions src/mithril.bindings.js
Expand Up @@ -65,8 +65,7 @@ var mithrilBindings = function(m){
// You can use .delay(true) to be able to manually handle updates
prop.subscribe(function(val){
if(!delay) {
m.startComputation();
m.endComputation();
m.redraw();
}
return prop;
});
Expand All @@ -75,9 +74,9 @@ var mithrilBindings = function(m){
};

// Element function that applies our extended bindings
// Note:
// Note:
// . Some attributes can be removed when applied, eg: custom attributes
//
//
m.e = function(element, attrs, children) {
for (var name in attrs) {
if (m.bindings[name]) {
Expand Down Expand Up @@ -170,7 +169,7 @@ var mithrilBindings = function(m){
}
}, true );

// Add value bindings for various event types
// Add value bindings for various event types
var events = ["Input", "Keyup", "Keypress"],
createBinding = function(name, eve){
// Bi-directional binding of value
Expand All @@ -197,7 +196,7 @@ var mithrilBindings = function(m){
};
};

/* Returns a function that can trigger a binding
/* Returns a function that can trigger a binding
Usage: onclick: m.trigger('binding', prop)
*/
m.trigger = function(){
Expand All @@ -224,4 +223,4 @@ if (typeof module != "undefined" && module !== null && module.exports) {
mithrilBindings(typeof window != "undefined"? window.m || {}: {});
}

}());
}());

0 comments on commit 0d1d553

Please sign in to comment.