This commit is contained in:
vitalets 2013-07-07 13:31:24 +04:00
parent 3bfaeda1ab
commit 6c247844a5
10 changed files with 71 additions and 22 deletions

3
dist/CHANGELOG.txt vendored

@ -3,6 +3,9 @@ X-editable changelog
Version 1.4.6 wip Version 1.4.6 wip
---------------------------- ----------------------------
[enh #287] add option to disable item in select (vitalets)
[enh #281] add collision flag to adjust tooltip position (vitalets)
[bug #279] fix jQuery UI tooltip z-index to be less than select2 dropdown (vitalets)
[bug #276] support id() and text() functions of select2 (vitalets) [bug #276] support id() and text() functions of select2 (vitalets)

@ -153,6 +153,7 @@
.editable-container.ui-widget { .editable-container.ui-widget {
font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */ font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */
z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */
} }
.editable-click, .editable-click,
a.editable-click, a.editable-click,

@ -1029,7 +1029,7 @@ Applied as jQuery method.
/* /*
TODO: added second param mainly to distinguish from bootstrap's shown event. It's a hotfix that will be solved in future versions via namespaced events. TODO: added second param mainly to distinguish from bootstrap's shown event. It's a hotfix that will be solved in future versions via namespaced events.
*/ */
this.$element.triggerHandler('shown', this); this.$element.triggerHandler('shown', $(this.options.scope).data('editable'));
}, this) }, this)
}) })
.editableform('render'); .editableform('render');
@ -2377,7 +2377,7 @@ To create your own input you can inherit from this class.
/** /**
Additional actions when destroying element Additional actions when destroying element
**/ **/
destroy: function() { destroy: function() {
}, },
// -------- helper functions -------- // -------- helper functions --------
@ -3030,12 +3030,19 @@ $(function(){
this.$input.empty(); this.$input.empty();
var fillItems = function($el, data) { var fillItems = function($el, data) {
var attr;
if($.isArray(data)) { if($.isArray(data)) {
for(var i=0; i<data.length; i++) { for(var i=0; i<data.length; i++) {
attr = {};
if(data[i].children) { if(data[i].children) {
$el.append(fillItems($('<optgroup>', {label: data[i].text}), data[i].children)); attr.label = data[i].text;
$el.append(fillItems($('<optgroup>', attr), data[i].children));
} else { } else {
$el.append($('<option>', {value: data[i].value}).text(data[i].text)); attr.value = data[i].value;
if(data[i].disabled) {
attr.disabled = true;
}
$el.append($('<option>', attr).text(data[i].text));
} }
} }
} }
@ -3663,6 +3670,12 @@ $(function(){
} }
} }
return source; return source;
},
destroy: function() {
if(this.$input.data('select2')) {
this.$input.select2('destroy');
}
} }
}); });
@ -3718,7 +3731,7 @@ $(function(){
* Dropdown date and time picker. * Dropdown date and time picker.
* Converts text input into dropdowns to pick day, month, year, hour, minute and second. * Converts text input into dropdowns to pick day, month, year, hour, minute and second.
* Uses momentjs as datetime library http://momentjs.com. * Uses momentjs as datetime library http://momentjs.com.
* For i18n include corresponding file from https://github.com/timrwood/moment/tree/master/lang * For internalization include corresponding file from https://github.com/timrwood/moment/tree/master/lang
* *
* Confusion at noon and midnight - see http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight * Confusion at noon and midnight - see http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight
* In combodate: * In combodate:

File diff suppressed because one or more lines are too long

@ -153,6 +153,7 @@
.editable-container.ui-widget { .editable-container.ui-widget {
font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */ font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */
z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */
} }
.editable-click, .editable-click,
a.editable-click, a.editable-click,

@ -1029,7 +1029,7 @@ Applied as jQuery method.
/* /*
TODO: added second param mainly to distinguish from bootstrap's shown event. It's a hotfix that will be solved in future versions via namespaced events. TODO: added second param mainly to distinguish from bootstrap's shown event. It's a hotfix that will be solved in future versions via namespaced events.
*/ */
this.$element.triggerHandler('shown', this); this.$element.triggerHandler('shown', $(this.options.scope).data('editable'));
}, this) }, this)
}) })
.editableform('render'); .editableform('render');
@ -2377,7 +2377,7 @@ To create your own input you can inherit from this class.
/** /**
Additional actions when destroying element Additional actions when destroying element
**/ **/
destroy: function() { destroy: function() {
}, },
// -------- helper functions -------- // -------- helper functions --------
@ -3030,12 +3030,19 @@ $(function(){
this.$input.empty(); this.$input.empty();
var fillItems = function($el, data) { var fillItems = function($el, data) {
var attr;
if($.isArray(data)) { if($.isArray(data)) {
for(var i=0; i<data.length; i++) { for(var i=0; i<data.length; i++) {
attr = {};
if(data[i].children) { if(data[i].children) {
$el.append(fillItems($('<optgroup>', {label: data[i].text}), data[i].children)); attr.label = data[i].text;
$el.append(fillItems($('<optgroup>', attr), data[i].children));
} else { } else {
$el.append($('<option>', {value: data[i].value}).text(data[i].text)); attr.value = data[i].value;
if(data[i].disabled) {
attr.disabled = true;
}
$el.append($('<option>', attr).text(data[i].text));
} }
} }
} }
@ -3663,6 +3670,12 @@ $(function(){
} }
} }
return source; return source;
},
destroy: function() {
if(this.$input.data('select2')) {
this.$input.select2('destroy');
}
} }
}); });
@ -3718,7 +3731,7 @@ $(function(){
* Dropdown date and time picker. * Dropdown date and time picker.
* Converts text input into dropdowns to pick day, month, year, hour, minute and second. * Converts text input into dropdowns to pick day, month, year, hour, minute and second.
* Uses momentjs as datetime library http://momentjs.com. * Uses momentjs as datetime library http://momentjs.com.
* For i18n include corresponding file from https://github.com/timrwood/moment/tree/master/lang * For internalization include corresponding file from https://github.com/timrwood/moment/tree/master/lang
* *
* Confusion at noon and midnight - see http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight * Confusion at noon and midnight - see http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight
* In combodate: * In combodate:

File diff suppressed because one or more lines are too long

@ -153,6 +153,7 @@
.editable-container.ui-widget { .editable-container.ui-widget {
font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */ font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */
z-index: 9990; /* should be less than select2 dropdown z-index to close dropdown first when click */
} }
.editable-click, .editable-click,
a.editable-click, a.editable-click,

@ -1029,7 +1029,7 @@ Applied as jQuery method.
/* /*
TODO: added second param mainly to distinguish from bootstrap's shown event. It's a hotfix that will be solved in future versions via namespaced events. TODO: added second param mainly to distinguish from bootstrap's shown event. It's a hotfix that will be solved in future versions via namespaced events.
*/ */
this.$element.triggerHandler('shown', this); this.$element.triggerHandler('shown', $(this.options.scope).data('editable'));
}, this) }, this)
}) })
.editableform('render'); .editableform('render');
@ -2377,7 +2377,7 @@ To create your own input you can inherit from this class.
/** /**
Additional actions when destroying element Additional actions when destroying element
**/ **/
destroy: function() { destroy: function() {
}, },
// -------- helper functions -------- // -------- helper functions --------
@ -3030,12 +3030,19 @@ $(function(){
this.$input.empty(); this.$input.empty();
var fillItems = function($el, data) { var fillItems = function($el, data) {
var attr;
if($.isArray(data)) { if($.isArray(data)) {
for(var i=0; i<data.length; i++) { for(var i=0; i<data.length; i++) {
attr = {};
if(data[i].children) { if(data[i].children) {
$el.append(fillItems($('<optgroup>', {label: data[i].text}), data[i].children)); attr.label = data[i].text;
$el.append(fillItems($('<optgroup>', attr), data[i].children));
} else { } else {
$el.append($('<option>', {value: data[i].value}).text(data[i].text)); attr.value = data[i].value;
if(data[i].disabled) {
attr.disabled = true;
}
$el.append($('<option>', attr).text(data[i].text));
} }
} }
} }
@ -3663,6 +3670,12 @@ $(function(){
} }
} }
return source; return source;
},
destroy: function() {
if(this.$input.data('select2')) {
this.$input.select2('destroy');
}
} }
}); });
@ -3718,7 +3731,7 @@ $(function(){
* Dropdown date and time picker. * Dropdown date and time picker.
* Converts text input into dropdowns to pick day, month, year, hour, minute and second. * Converts text input into dropdowns to pick day, month, year, hour, minute and second.
* Uses momentjs as datetime library http://momentjs.com. * Uses momentjs as datetime library http://momentjs.com.
* For i18n include corresponding file from https://github.com/timrwood/moment/tree/master/lang * For internalization include corresponding file from https://github.com/timrwood/moment/tree/master/lang
* *
* Confusion at noon and midnight - see http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight * Confusion at noon and midnight - see http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight
* In combodate: * In combodate:
@ -4466,25 +4479,29 @@ Editableform based on jQuery UI
case 'top': case 'top':
pos = { pos = {
my: "center bottom-5", my: "center bottom-5",
at: "center top" at: "center top",
collision: 'flipfit'
}; };
break; break;
case 'right': case 'right':
pos = { pos = {
my: "left+5 center", my: "left+5 center",
at: "right center" at: "right center",
collision: 'flipfit'
}; };
break; break;
case 'bottom': case 'bottom':
pos = { pos = {
my: "center top+5", my: "center top+5",
at: "center bottom" at: "center bottom",
collision: 'flipfit'
}; };
break; break;
case 'left': case 'left':
pos = { pos = {
my: "right-5 center", my: "right-5 center",
at: "left center" at: "left center",
collision: 'flipfit'
}; };
break; break;
} }

File diff suppressed because one or more lines are too long