Skip to content

Commit

Permalink
improved the way binding happens, allowing filtered child elems by de…
Browse files Browse the repository at this point in the history
…fault
  • Loading branch information
dhigginbotham committed Sep 15, 2015
1 parent 633db9d commit c4baa50
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .publish
Submodule .publish updated from 363c6c to d98021
2 changes: 1 addition & 1 deletion dist/murk.js

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

Binary file modified dist/murk.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/build/templates/repeat-example.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="hero">
<div data-murk="repeatedExample" data-murk-id="repeat">
<div>
Name: <span data-murk-repeat-key="name" data-murk-repeat-bind="true" data-murk-filter="highlightText"></span>
Name: <span data-murk-repeat-key="name" data-murk-filter="highlightText"></span>
</div>
<div>
Age: <span data-murk-repeat-key="age"></span>
Expand Down
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h3 name="repeat-example">Repeat Example: </h3>
<div class="hero">
<div data-murk="repeatedExample" data-murk-id="repeat">
<div>
Name: <span data-murk-repeat-key="name" data-murk-repeat-bind="true" data-murk-filter="highlightText"></span>
Name: <span data-murk-repeat-key="name" data-murk-filter="highlightText"></span>
</div>
<div>
Age: <span data-murk-repeat-key="age"></span>
Expand Down
14 changes: 7 additions & 7 deletions examples/js/murk.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var murk = (function(fn) {
;(function(def, fn) {
if (typeof module != 'undefined' && module.exports) {
module.exports = fn;
} else {
return fn;
window[def] = fn;
}
})(function(options) {
})('murk', function murk(options) {
if (!(this instanceof murk)) return new murk(options);
// state reference, mostly for
// dev/internal use and context
Expand All @@ -24,7 +24,6 @@ var murk = (function(fn) {
selectorPrefix: 'data-murk',
dev: false,
id: state.start,
bindRepeats: false,
defaultSubscribers: [handleRepeat, elemBindingEvent, processFiltersEvent, trackCountEvent]
};

Expand All @@ -45,6 +44,7 @@ var murk = (function(fn) {
// this way you're not overwriting
// the model unless you intend to
merge = (typeof merge != 'undefined' ? merge : true);

if (typeof str != 'undefined' && typeof obj == 'string') {
state.model[obj] = str;
// if we've set this elem before we'll
Expand Down Expand Up @@ -174,7 +174,7 @@ var murk = (function(fn) {
// hey, if you want to bind repeats --
// know that it's possible with this opt
// but also know it isn't quite as performant
if (opts.bindRepeats || isBind) {
if (isBind) {
var $$key = this.$key + '.' + repeatKey;
if (!atts(opts.selectorPrefix)) {
atts(opts.selectorPrefix, $$key);
Expand Down Expand Up @@ -332,9 +332,9 @@ var murk = (function(fn) {

// handles dom manipulation
function setupTextNode(el, val) {
var tn;
if (typeof val != 'undefined') {
tn = document.createTextNode(val);
if (val === 'null' || val === null) val = '';
var tn = document.createTextNode(val);
if (el.hasChildNodes()) {
el.childNodes[0].nodeValue = val;
} else {
Expand Down
14 changes: 7 additions & 7 deletions src/murk.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var murk = (function(fn) {
;(function(def, fn) {
if (typeof module != 'undefined' && module.exports) {
module.exports = fn;
} else {
return fn;
window[def] = fn;
}
})(function(options) {
})('murk', function murk(options) {
if (!(this instanceof murk)) return new murk(options);
// state reference, mostly for
// dev/internal use and context
Expand All @@ -24,7 +24,6 @@ var murk = (function(fn) {
selectorPrefix: 'data-murk',
dev: false,
id: state.start,
bindRepeats: false,
defaultSubscribers: [handleRepeat, elemBindingEvent, processFiltersEvent, trackCountEvent]
};

Expand All @@ -45,6 +44,7 @@ var murk = (function(fn) {
// this way you're not overwriting
// the model unless you intend to
merge = (typeof merge != 'undefined' ? merge : true);

if (typeof str != 'undefined' && typeof obj == 'string') {
state.model[obj] = str;
// if we've set this elem before we'll
Expand Down Expand Up @@ -174,7 +174,7 @@ var murk = (function(fn) {
// hey, if you want to bind repeats --
// know that it's possible with this opt
// but also know it isn't quite as performant
if (opts.bindRepeats || isBind) {
if (isBind) {
var $$key = this.$key + '.' + repeatKey;
if (!atts(opts.selectorPrefix)) {
atts(opts.selectorPrefix, $$key);
Expand Down Expand Up @@ -332,9 +332,9 @@ var murk = (function(fn) {

// handles dom manipulation
function setupTextNode(el, val) {
var tn;
if (typeof val != 'undefined') {
tn = document.createTextNode(val);
if (val === 'null' || val === null) val = '';
var tn = document.createTextNode(val);
if (el.hasChildNodes()) {
el.childNodes[0].nodeValue = val;
} else {
Expand Down

0 comments on commit c4baa50

Please sign in to comment.