add prerender method in inputs to fix bug on second open
This commit is contained in:
@@ -40,26 +40,41 @@ $(function () {
|
||||
}
|
||||
});
|
||||
|
||||
equal(frmt(e.data('editable').value, 'dd.mm.yyyy'), d, 'value correct');
|
||||
//testing func, run twice!
|
||||
var func = function() {
|
||||
var df = $.Deferred();
|
||||
|
||||
equal(frmt(e.data('editable').value, 'dd.mm.yyyy'), d, 'value correct');
|
||||
|
||||
e.click();
|
||||
var p = tip(e);
|
||||
ok(p.find('.ui-datepicker').is(':visible'), 'datepicker exists');
|
||||
equal(p.find('.ui-datepicker').length, 1, 'datepicker single');
|
||||
|
||||
e.click();
|
||||
var p = tip(e);
|
||||
ok(p.find('.ui-datepicker').is(':visible'), 'datepicker exists');
|
||||
|
||||
equal(p.find('a.ui-state-active').text(), 15, 'day shown correct');
|
||||
equal(p.find('.ui-datepicker-calendar > thead > tr > th').eq(0).find('span').text(), 'Mo', 'weekStart correct');
|
||||
equal(p.find('a.ui-state-active').text(), 15, 'day shown correct');
|
||||
equal(p.find('.ui-datepicker-calendar > thead > tr > th').eq(0).find('span').text(), 'Mo', 'weekStart correct');
|
||||
|
||||
//set new day
|
||||
p.find('a.ui-state-active').parent().next().click();
|
||||
p.find('form').submit();
|
||||
|
||||
setTimeout(function() {
|
||||
ok(!p.is(':visible'), 'popover closed');
|
||||
equal(frmt(e.data('editable').value, 'dd.mm.yyyy'), nextD, 'new date saved to value');
|
||||
equal(e.text(), nextDview, 'new text shown');
|
||||
e.remove();
|
||||
start();
|
||||
}, timeout);
|
||||
//set new day
|
||||
p.find('a.ui-state-active').parent().next().click();
|
||||
p.find('form').submit();
|
||||
|
||||
setTimeout(function() {
|
||||
ok(!p.is(':visible'), 'popover closed');
|
||||
equal(frmt(e.data('editable').value, 'dd.mm.yyyy'), nextD, 'new date saved to value');
|
||||
equal(e.text(), nextDview, 'new text shown');
|
||||
df.resolve();
|
||||
}, timeout);
|
||||
|
||||
return df.promise();
|
||||
};
|
||||
|
||||
$.when(func()).then(function() {
|
||||
e.editable('setValue', d, true);
|
||||
$.when(func()).then(function() {
|
||||
e.remove();
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user