mode beta ready
This commit is contained in:
@ -20,7 +20,11 @@ define(function () {
|
||||
init: function(require) {
|
||||
loadCss(require.toUrl("./editable-container.css"));
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
//inline container
|
||||
'containers/editable-inline': ['containers/editable-container'],
|
||||
|
||||
'element/editable-element': {
|
||||
deps: ['require'], //here should be dynamically added container
|
||||
init: function(require) {
|
||||
@ -55,11 +59,12 @@ define(function () {
|
||||
}
|
||||
},
|
||||
'editable-form/editable-form-bootstrap': [
|
||||
'editable-form/editable-form',
|
||||
'bootstrap/js/bootstrap'
|
||||
'editable-form/editable-form',
|
||||
'bootstrap/js/bootstrap'
|
||||
],
|
||||
'containers/editable-popover': ['containers/editable-container',
|
||||
'bootstrap/js/bootstrap'
|
||||
'containers/editable-popover': [
|
||||
'containers/editable-inline',
|
||||
'bootstrap/js/bootstrap'
|
||||
],
|
||||
'inputs/date/date': {
|
||||
deps: ['require',
|
||||
@ -79,19 +84,20 @@ define(function () {
|
||||
}
|
||||
},
|
||||
'editable-form/editable-form-jqueryui': [
|
||||
'editable-form/editable-form',
|
||||
'jqueryui/js/jquery-ui-1.9.1.custom'
|
||||
'editable-form/editable-form',
|
||||
'jqueryui/js/jquery-ui-1.9.1.custom'
|
||||
],
|
||||
'containers/editable-tooltip': ['containers/editable-container',
|
||||
'jqueryui/js/jquery-ui-1.9.1.custom'
|
||||
'containers/editable-tooltip': [
|
||||
'containers/editable-inline',
|
||||
'jqueryui/js/jquery-ui-1.9.1.custom'
|
||||
],
|
||||
'inputs/dateui/dateui': ['inputs/abstract'],
|
||||
|
||||
//plain
|
||||
//'inputs/dateui/dateui': ['inputs/abstract', 'inputs/date/bootstrap-datepicker/js/bootstrap-datepicker'],
|
||||
'containers/editable-poshytip': [
|
||||
'containers/editable-container',
|
||||
'poshytip/jquery.poshytip'
|
||||
'containers/editable-inline',
|
||||
'poshytip/jquery.poshytip'
|
||||
],
|
||||
'poshytip/jquery.poshytip': {
|
||||
deps: ['require'],
|
||||
@ -105,9 +111,7 @@ define(function () {
|
||||
loadCss(require.toUrl("../css/redmond/jquery-ui-1.9.1.custom.css"));
|
||||
}
|
||||
},
|
||||
|
||||
//inline container
|
||||
'containers/editable-inline': ['containers/editable-container'],
|
||||
|
||||
|
||||
//inputs-ext
|
||||
'inputs-ext/address/address': {
|
||||
@ -126,17 +130,17 @@ define(function () {
|
||||
//bootstrap
|
||||
shim['editable-form/editable-form'].deps.push('inputs/date/date');
|
||||
shim['element/editable-element'].deps.push('editable-form/editable-form-bootstrap');
|
||||
shim['element/editable-element'].deps.push(c === 'popup' ? 'containers/editable-popover' : 'containers/editable-inline');
|
||||
shim['element/editable-element'].deps.push('containers/editable-popover');
|
||||
} else if(f === 'jqueryui') {
|
||||
//jqueryui
|
||||
shim['editable-form/editable-form'].deps.push('inputs/dateui/dateui');
|
||||
shim['element/editable-element'].deps.push('editable-form/editable-form-jqueryui');
|
||||
shim['element/editable-element'].deps.push(c === 'popup' ? 'containers/editable-tooltip' : 'containers/editable-inline');
|
||||
shim['element/editable-element'].deps.push('containers/editable-tooltip');
|
||||
} else {
|
||||
//plain
|
||||
shim['editable-form/editable-form'].deps.push('inputs/dateui/dateui');
|
||||
shim['inputs/dateui/dateui'].push('inputs/dateui/jquery-ui-datepicker/js/jquery-ui-1.9.1.custom');
|
||||
shim['element/editable-element'].deps.push(c === 'popup' ? 'containers/editable-poshytip' : 'containers/editable-inline');
|
||||
shim['element/editable-element'].deps.push('containers/editable-poshytip');
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,7 +19,8 @@ require(["loader", jqurl], function(loader) {
|
||||
function() {
|
||||
//disable effects
|
||||
$.fx.off = true;
|
||||
$.support.transition = false;
|
||||
$.support.transition = false;
|
||||
$.fn.editable.defaults.mode = params.c === 'inline' ? 'inline' : 'popup';
|
||||
|
||||
QUnit.load();
|
||||
QUnit.start();
|
||||
|
@ -64,7 +64,7 @@
|
||||
|
||||
test("container's title and placement from json options", function () {
|
||||
//do not test inline
|
||||
if($.fn.editableContainer.Constructor.prototype.containerName === 'editableform') {
|
||||
if($.fn.editable.defaults.mode === 'inline') {
|
||||
expect(0);
|
||||
return;
|
||||
}
|
||||
@ -81,7 +81,7 @@
|
||||
ok(p.is(':visible'), 'popover shown');
|
||||
|
||||
//todo: for jqueryui phantomjs calcs wrong position. Need investigation
|
||||
if(!$.browser.webkit && $.fn.editableContainer.Constructor.prototype.containerName !== 'tooltip') {
|
||||
if(!$.browser.webkit && e.data('editableContainer').containerName !== 'tooltip') {
|
||||
ok(p.offset().top > e.offset().top, 'placement ok');
|
||||
}
|
||||
|
||||
@ -520,5 +520,23 @@
|
||||
|
||||
});
|
||||
|
||||
test("mode: popup / inline", function () {
|
||||
var e = $('<a href="#" id="a"></a>').appendTo('#qunit-fixture').editable({
|
||||
mode: 'popup'
|
||||
}),
|
||||
e1 = $('<a href="#" id="a1"></a>').appendTo('#qunit-fixture').editable({
|
||||
mode: 'inline'
|
||||
});
|
||||
|
||||
e.click();
|
||||
var p = tip(e);
|
||||
ok(p.is(':visible'), 'popup visible');
|
||||
ok(!p.hasClass('editable-inline'), 'no inline class');
|
||||
|
||||
e1.click();
|
||||
p = tip(e1);
|
||||
ok(p.is(':visible'), 'inline visible visible');
|
||||
ok(p.hasClass('editable-inline'), 'has inline class');
|
||||
});
|
||||
|
||||
}(jQuery));
|
Reference in New Issue
Block a user