Opened 11 years ago

Closed 11 years ago

#10349 closed Bug (invalid)

show('blind') problem

Reported by: Viktor Nemeth Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Hi,

I use multiple editors in one form. my script is here:

$(document).ready(function() {
$('textarea.editor').each(function(){
    CKEDITOR.replace( $(this).attr('id'), {} );
});
});

So if i want a block (what contain editors) showing javascript, the contained text is dissapear.

This show alterative is work: $('div#id').show(); But this is not: $('div#id').show('blind');

Attachments (1)

replacebycode2.html (3.6 KB) - added by Jakub Ś 11 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 11 years ago by Jakub Ś

Status: newpending

So if i want a block (what contain editors) showing javascript

Sorry but I'm lost. I don't understand what you mean. Could you attach sample and working page you are using and explain in step by step scenario what you are trying to do and what is going wrong?

comment:2 Changed 11 years ago by Viktor Nemeth

Sorry, here is the code. I hope this is helpful:

<form method="post" class="validForm" action="actionURL" enctype="multipart/form-data">

<select name="category" id="category" onChange="changeCategory()">
<?php
if ($content['category']=='rings') { $rings = 'selected';}
else if ($content['category']=='earrings') { $earrings = 'selected';}
else if ($content['category']=='bracelets') { $bracelets = 'selected';}
else if ($content['category']=='necklance-medal') { $necklance_medal = 'selected';}
else if ($content['category']=='collections') { $collections = 'selected';}
echo '<option value="rings" '.$rings.'>Gyűrűk</option>
<option value="earrings" '.$earrings.'>Fülbevalók</option>
<option value="bracelets" '.$bracelets.'>Karkötők</option>
<option value="necklance-medal" '.$necklance_medal.'>Nyaklánc / Medál</option>
<option value="collections" '.$collections.'>Kollekció</option>';
?>
</select>

<textarea class="editor" id="editor1" name="details"><?=$content['details']?></textarea><br>

<div id="category_panel"> // THIS PANEL IS HIDE IF COLLECTION NOT SELECTED
<h2>2. item</h2>
<input name="sku2" type="text" placeholder="SKU 2" class="required" value="<?=$content['sku2']?>" />
<textarea class="editor" id="editor2" name="details2"><?=$content['details2']?></textarea><br>
<h2>3. item</h2>
<input name="sku3" type="text" placeholder="SKU 3" value="<?=$content['sku3']?>" />
<textarea class="editor" id="editor3" name="details3"><?=$content['details3']?></textarea><br>
<h2>4. item</h2>
<input name="sku4" type="text" placeholder="SKU 4" value="<?=$content['sku4']?>" />
<textarea class="editor" id="editor4" name="details4"><?=$content['details4']?></textarea><br><br>
<h2>Collection details</h2>
<textarea class="editor" id="editor5" name="details_collection"><?=$content['details_collection']?></textarea><br>
</div>

<div class="submit"><input value="<?=$lang['SAVE']?>" type="submit" /></div>
</form>

<script type="text/javascript">
$('#category_panel').hide();
var category = $('#category').val();
if (category=='collections'){
	$('#category_panel').show('blind'); // THIS IS THE WRONG LINE. REPLACED $('#category_panel').show();
}
	
function changeCategory() {
    var category = $('#category').val();
	if (category=='collections'){
		$('#category_panel').show();
	}
	else{
		$('#category_panel').hide();
	}
}

$(document).ready(function() {
$('textarea.editor').each(function(){
    CKEDITOR.replace( $(this).attr('id'), {
	forcePasteAsPlainText : true,
        enterMode : CKEDITOR.ENTER_BR,
        shiftEnterMode : CKEDITOR.ENTER_P,
		toolbar :
		[
	    { name: 'document', items : [ 'Source'] },
            { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
            { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent'] },
            { name: 'links', items : [ 'Link','Unlink' ] },
            { name: 'insert', items : [ 'Table','SpecialChar' ] },
            { name: 'styles', items : [ 'FontSize' ] },
            { name: 'colors', items : [ 'TextColor' ] }
		]} );
});
});

</script>

comment:3 Changed 11 years ago by Jakub Ś

Ok, thanks I will check this. Any chance for extra explanation of the problem?

So if i want a block (what contain editors) showing javascript

I still don't understand what you meant by the above sentence.

comment:4 Changed 11 years ago by Jakub Ś

Resolution: invalid
Status: pendingclosed

I have checked your code. This has nothing to do with CKEditor but wrong usage of jQuery. I attaching working file but please don't send such requests as this isn't support site but place for reporting bugs!

Changed 11 years ago by Jakub Ś

Attachment: replacebycode2.html added
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy