Mercurial > defr > drupal > scald > dnd
comparison js/dnd-library.js @ 28:7d6bf2dca269
Completely broken library registration, fixed a typo.
| author | David Eads <eads@chicagotech.org> |
|---|---|
| date | Tue, 17 Mar 2009 06:25:47 -0500 |
| parents | 9a92410be362 |
| children | 2d49adbd8992 |
comparison
equal
deleted
inserted
replaced
| 27:9a92410be362 | 28:7d6bf2dca269 |
|---|---|
| 47 // Bind Drag and Drop plugin invocation to events emanating from Wysiwyg | 47 // Bind Drag and Drop plugin invocation to events emanating from Wysiwyg |
| 48 $editor.bind('wysiwygAttach', Drupal.behaviors.dndLibrary.attach_library); | 48 $editor.bind('wysiwygAttach', Drupal.behaviors.dndLibrary.attach_library); |
| 49 $editor.bind('wysiwygDetach', Drupal.behaviors.dndLibrary.detach_library); | 49 $editor.bind('wysiwygDetach', Drupal.behaviors.dndLibrary.detach_library); |
| 50 | 50 |
| 51 // Add preview behavior to editor items (thanks, BeautyTips!) | 51 // Add preview behavior to editor items (thanks, BeautyTips!) |
| 52 $('.editor-item', context).each(function () { | 52 $('.editor-item', $this).each(function () { |
| 53 $(this).bt(Drupal.settings.dndLibraryPreviews[this.id], bt_settings); | 53 $(this).bt(Drupal.settings.dndLibraryPreviews[this.id], bt_settings); |
| 54 var hover_opts = $.extend({ | 54 var hover_opts = $.extend({ |
| 55 'interval': 500, | 55 'interval': 500, |
| 56 'timeout' : 0, | 56 'timeout' : 0, |
| 57 'over': function() { | 57 'over': function() { |
| 264 var next = $inserted.next().get(0); | 264 var next = $inserted.next().get(0); |
| 265 | 265 |
| 266 // If the next item exists and isn't an editor representation, drop the | 266 // If the next item exists and isn't an editor representation, drop the |
| 267 // caret at the beginning of the element, otherwise make a new paragraph | 267 // caret at the beginning of the element, otherwise make a new paragraph |
| 268 // to advance the caret to. | 268 // to advance the caret to. |
| 269 if (next && !$(next).hasClass('dnd-droped-wrapper')) { | 269 if (next && !$(next).hasClass('dnd-dropped-wrapper')) { |
| 270 $(next).prepend('<span id="__caret">_</span>'); | 270 $(next).prepend('<span id="__caret">_</span>'); |
| 271 } | 271 } |
| 272 else { | 272 else { |
| 273 var after = dom.create('p', {}, '<span id="__caret">_</span>'); | 273 var after = dom.create('p', {}, '<span id="__caret">_</span>'); |
| 274 dom.insertAfter(after, 'dnd-inserted'); | 274 dom.insertAfter(after, 'dnd-inserted'); |
