[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/yui_editor/plugins/ -> resize.js (source)

   1  // $Id: resize.js,v 1.1.2.1.2.1 2008/11/21 22:54:27 jeffcd Exp $
   2  
   3  function yui_editor_resize() {
   4    for (var e in YAHOO.Drupal.editors) {
   5      var myEditor = YAHOO.Drupal.editors[e].editor;
   6      var config = YAHOO.Drupal.editors[e].config;
   7  
   8      if (config.resize == 1) {
   9        myEditor.on('editorContentLoaded', function() {
  10          resize = new YAHOO.util.Resize(myEditor.get('element_cont').get('element'), {
  11            handles: ['br'],
  12            autoRatio: true,
  13            status: true,
  14            proxy: true
  15          });
  16          resize.on('startResize', function() {
  17            this.hide();
  18            this.set('disabled', true);
  19          }, myEditor, true);
  20          resize.on('resize', function(args) {
  21            var h = args.height;
  22            var th = (this.toolbar.get('element').clientHeight + 2); //It has a 1px border..
  23            var dh = (this.dompath.clientHeight + 1); //It has a 1px top border..
  24            var newH = (h - th - dh);
  25            this.set('width', args.width + 'px');
  26            this.set('height', newH + 'px');
  27            this.set('disabled', false);
  28            this.show();
  29          }, myEditor, true);
  30        });
  31      }
  32    }
  33  }
  34  YAHOO.Drupal.yui_editor_load.subscribe(yui_editor_resize);


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7