Skip to content

Commit

Permalink
Linted
Browse files Browse the repository at this point in the history
  • Loading branch information
stephband committed Dec 15, 2016
1 parent f6241bc commit ccf851e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules
/test-coverage
npm-debug.log
7 changes: 4 additions & 3 deletions js/sparky.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@

// Export

var fragments = {};

assign(Sparky, {
debug: false,
log: log,
Expand All @@ -570,14 +572,13 @@
fn: {},

template: function(id, node) {
// Todo: Store node in a cache. This used to responsibility of
// dom.js. No more.
if (node) {
console.warn('Cant cache Sparky.template(id, node)')
return;
}

return dom.fragmentFromId(id);
var fragment = fragments[id] || (fragments[id] = dom.fragmentFromId(id));
return fragment.cloneNode(true);
}
});

Expand Down
7 changes: 4 additions & 3 deletions js/sparky.observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@
}
}

Sparky.observePath = Sparky.try(observePath, function message(root, path) {
return 'Sparky: failed to observe path "' + path + '" in object ' + JSON.stringify(root);
});
//Sparky.observePath = Sparky.try(observePath, function message(root, path) {
// return 'Sparky: failed to observe path "' + path + '" in object ' + JSON.stringify(root);
//});

Sparky.observePath = observePath;
Sparky.unobservePath = unobservePath;
Sparky.observePathOnce = observePathOnce;

Expand Down
11 changes: 6 additions & 5 deletions package/sparky.js
Original file line number Diff line number Diff line change
Expand Up @@ -3756,9 +3756,9 @@ if (!Math.log10) {
// Data parent is a workaround for browsers that don't support inert
// templates. Allows the author to specify a context inside which
// the template is parsed. Where a template has top level <td>s, for
// example, it should have data-parent="tr", or the <td>s will be
// example, it should have data-parent-tag="tr", or the <td>s will be
// removed by the browser.
return fragmentFromHTML(node.innerHTML, node.getAttribute('data-parent'));
return fragmentFromHTML(node.innerHTML, node.getAttribute('data-parent-tag'));
}
else if (tag === 'template') {
// In browsers where templates are not inert, ids used inside them
Expand Down Expand Up @@ -4081,10 +4081,11 @@ if (!Math.log10) {
}
}

Sparky.observePath = Sparky.try(observePath, function message(root, path) {
return 'Sparky: failed to observe path "' + path + '" in object ' + JSON.stringify(root);
});
//Sparky.observePath = Sparky.try(observePath, function message(root, path) {
// return 'Sparky: failed to observe path "' + path + '" in object ' + JSON.stringify(root);
//});

Sparky.observePath = observePath;
Sparky.unobservePath = unobservePath;
Sparky.observePathOnce = observePathOnce;

Expand Down
2 changes: 1 addition & 1 deletion package/sparky.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions plugins/sparky.fn.suggest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(function(window) {
var dom = window.dom;
var Sparky = window.Sparky;
var Fn = window.Fn;
var dom = window.dom;
var Collection = window.Collection;
var Sparky = window.Sparky;

function wrap(i, min, max) {
return i < min ? max - (min - i) :
Expand Down

0 comments on commit ccf851e

Please sign in to comment.