diff --git a/js/linkswidget.js b/js/linkswidget.js index 9d74a52f9..f71343fb9 100644 --- a/js/linkswidget.js +++ b/js/linkswidget.js @@ -16,6 +16,11 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH $('#linkedset_'+this.id+' .selection').each( function() { this.checked = false; }); $('#'+this.id+'_btnRemove').attr('disabled','disabled'); $('#'+this.id+'_linksToRemove').val(''); + + $('#linkedset_'+me.id).on('remove', function() { + // prevent having the dlg div twice + $('#dlg_'+me.id).remove(); + }); }; this.RemoveSelected = function() @@ -294,7 +299,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH this.GetUpdatedValue = function() { - var sSelector = '#linkedset_'+me.id+' input[name^=attr_'+me.id+']'; + var sSelector = '#linkedset_'+me.id+' :input[name^=attr_'+me.id+']'; var aIndexes = []; var aValues = []; $(sSelector).each(function() { diff --git a/js/wizardhelper.js b/js/wizardhelper.js index ef36ba202..a76d8f9b0 100644 --- a/js/wizardhelper.js +++ b/js/wizardhelper.js @@ -236,7 +236,7 @@ function WizardHelper(sClass, sFormPrefix, sState) $('#'+sFormId).find('.htmlEditor').each(function() { var sId = $(this).attr('id'); var editorInst = CKEDITOR.instances[sId]; - if (editorInst) + if (editorInst.status == 'ready') { editorInst.destroy(true); }