allow html as editable content, fix , fix , fix

This commit is contained in:
vitalets
2013-06-15 16:36:35 +04:00
parent 683f7d2128
commit 118b5a50d4
3 changed files with 41 additions and 2 deletions

@ -434,7 +434,28 @@ $(function () {
start();
}, timeout);
});
});
test("'display' returning html only (img)", function () {
var c = 0,
html = '<img src="../src/img/clear.png">',
html_br = '<br>',
e = $('<a href="#" data-pk="1" data-type="text" data-name="text1">0</a>').appendTo('#qunit-fixture').editable({
display: function(value, response) {
$(this).html(c == 0 ? html : html_br);
}
});
equal(e.html(), html, 'html ok');
c = 1;
e.click()
var p = tip(e);
p.find('input').val(1);
p.find('form').submit();
equal(e.html(), $.fn.editable.defaults.emptytext, 'html br --> emptytext ok');
});
test("password", function () {
var v = '123', v1 = '456';