Merge pull request #9406 from MrPetovan/bug/9385-frio-edit-detach
[frio] Keep jQuery data attached to elements stored in jotcache
This commit is contained in:
commit
e757711c38
|
@ -574,29 +574,29 @@
|
||||||
var tagsinput = $(this).data('tagsinput');
|
var tagsinput = $(this).data('tagsinput');
|
||||||
// Initialize a new tags input
|
// Initialize a new tags input
|
||||||
if (!tagsinput) {
|
if (!tagsinput) {
|
||||||
tagsinput = new TagsInput(this, arg1);
|
tagsinput = new TagsInput(this, arg1);
|
||||||
$(this).data('tagsinput', tagsinput);
|
$(this).data('tagsinput', tagsinput);
|
||||||
results.push(tagsinput);
|
results.push(tagsinput);
|
||||||
|
|
||||||
if (this.tagName === 'SELECT') {
|
if (this.tagName === 'SELECT') {
|
||||||
$('option', $(this)).attr('selected', 'selected');
|
$('option', $(this)).attr('selected', 'selected');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init tags from $(this).val()
|
// Init tags from $(this).val()
|
||||||
$(this).val($(this).val());
|
$(this).val($(this).val());
|
||||||
} else if (!arg1 && !arg2) {
|
} else if (!arg1 && !arg2) {
|
||||||
// tagsinput already exists
|
// tagsinput already exists
|
||||||
// no function, trying to init
|
// no function, trying to init
|
||||||
results.push(tagsinput);
|
results.push(tagsinput);
|
||||||
} else if(tagsinput[arg1] !== undefined) {
|
} else if(tagsinput[arg1] !== undefined) {
|
||||||
// Invoke function on existing tags input
|
// Invoke function on existing tags input
|
||||||
if(tagsinput[arg1].length === 3 && arg3 !== undefined){
|
if(tagsinput[arg1].length === 3 && arg3 !== undefined){
|
||||||
var retVal = tagsinput[arg1](arg2, null, arg3);
|
var retVal = tagsinput[arg1](arg2, null, arg3);
|
||||||
}else{
|
}else{
|
||||||
var retVal = tagsinput[arg1](arg2);
|
var retVal = tagsinput[arg1](arg2);
|
||||||
}
|
}
|
||||||
if (retVal !== undefined)
|
if (retVal !== undefined)
|
||||||
results.push(retVal);
|
results.push(retVal);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ function editpost(url) {
|
||||||
jotcache = $("#jot-content > #jot-sections");
|
jotcache = $("#jot-content > #jot-sections");
|
||||||
|
|
||||||
// Remove the original Jot as long as the edit Jot is open.
|
// Remove the original Jot as long as the edit Jot is open.
|
||||||
jotcache.remove();
|
jotcache.detach();
|
||||||
|
|
||||||
// Add the class "edit" to the modal to have some kind of identifier to
|
// Add the class "edit" to the modal to have some kind of identifier to
|
||||||
// have the possibility to e.g. put special event-listener.
|
// have the possibility to e.g. put special event-listener.
|
||||||
|
|
Loading…
Reference in a new issue