| 1 |
// $Id$
|
| 2 |
|
| 3 |
$(document).ready(
|
| 4 |
function(){
|
| 5 |
$('a.asset-textarea-link').each(
|
| 6 |
function(){
|
| 7 |
var textarea_id = this.id.replace('asset-link-', '');
|
| 8 |
var mcelink_id = 'wysiwyg4' + textarea_id.replace('edit-', '');
|
| 9 |
var mceLink = $('#' + mcelink_id);
|
| 10 |
var assetLink = this;
|
| 11 |
|
| 12 |
mceLink.click(
|
| 13 |
function(){
|
| 14 |
// this seems kinda backward but since this fires before mceToggle
|
| 15 |
// when there is no editor, then that means that the editor will
|
| 16 |
// be created on this click, and so the link needs to be hidden.
|
| 17 |
if(tinyMCE.getEditorId(textarea_id) == null){
|
| 18 |
// editor will be created so hide asset link
|
| 19 |
$(assetLink).hide();
|
| 20 |
}else{
|
| 21 |
// editor will be removed so show asset link
|
| 22 |
$(assetLink).show();
|
| 23 |
}
|
| 24 |
}
|
| 25 |
).click();
|
| 26 |
}
|
| 27 |
); // each
|
| 28 |
}
|
| 29 |
);
|