Skip to content

Commit

Permalink
remove text directive (pretty useless)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 5, 2017
1 parent 5380d31 commit b18b578
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
6 changes: 0 additions & 6 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -1996,12 +1996,6 @@
}
};

specialDirectives[Moon.config.prefix + "text"] = {
beforeGenerate: function (value, meta, vnode) {
vnode.children = [value];
}
};

directives[Moon.config.prefix + "show"] = function (el, val, vnode) {
el.style.display = val ? '' : 'none';
};
Expand Down
2 changes: 1 addition & 1 deletion dist/moon.min.js

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions src/directives/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ specialDirectives[Moon.config.prefix + "html"] = {
}
}

specialDirectives[Moon.config.prefix + "text"] = {
beforeGenerate: function(value, meta, vnode) {
vnode.children = [value];
}
}

directives[Moon.config.prefix + "show"] = function(el, val, vnode) {
el.style.display = (val ? '' : 'none');
}
Expand Down
16 changes: 0 additions & 16 deletions test/js/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,22 +491,6 @@ describe("Directive", function() {
});
});

describe('Text Directive', function() {
createTestElement("text", '<span m-text="{{msg}}" id="text-directive-span"></span>');
var textApp = new Moon({
el: "#text",
data: {
msg: "Hello Moon!"
}
});
it('should fill DOM with a value', function() {
expect(document.getElementById("text-directive-span").innerHTML).to.equal("Hello Moon!");
});
it('should not be present at runtime', function() {
expect(document.getElementById('text-directive-span').getAttribute("m-text")).to.be['null'];
});
});

describe('Mask Directive', function() {
createTestElement("mask", '<span m-mask id="mask-directive-span">{{msg}}</span>');
var maskApp = new Moon({
Expand Down

0 comments on commit b18b578

Please sign in to comment.