/[drupal]/contributions/modules/asset/tinymce/asset_tinymce_helper.js
ViewVC logotype

Contents of /contributions/modules/asset/tinymce/asset_tinymce_helper.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Tue Aug 7 22:22:06 2007 UTC (2 years, 3 months ago) by rz
Branch: MAIN
CVS Tags: DRUPAL-5--2-0-BETA1, HEAD
Branch point for: DRUPAL-5, DRUPAL-5--2
File MIME type: text/javascript
Hide "insert assets" link below textareas when tinymce editor is visible.
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 );

  ViewVC Help
Powered by ViewVC 1.1.2