app/assets/javascripts/formagic/inputs/redactor_images.coffee in formagic-0.3.4 vs app/assets/javascripts/formagic/inputs/redactor_images.coffee in formagic-0.3.7
- old
+ new
@@ -1,17 +1,11 @@
# -----------------------------------------------------------------------------
# Author: Alexander Kravets <alex@slatestudio.com>,
# Slate Studio (http://www.slatestudio.com)
-#
-# Coding Guide:
-# https://github.com/thoughtbot/guides/tree/master/style/coffeescript
# -----------------------------------------------------------------------------
-
-# -----------------------------------------------------------------------------
# REDACTOR IMAGES
# -----------------------------------------------------------------------------
-
class @RedactorImages
constructor: (@redactor) ->
@redactor.opts.modal.imageEdit = @_modal_edit_image()
@redactor.image.update = ($image) => @update($image)
@@ -39,11 +33,10 @@
<input type="text" id="redactor-image-link-title" class="redactor-image-link-option" />
<label class="redactor-image-link-option"><input type="checkbox" id="redactor-image-link-blank"> Open link in new tab</label>
</section>"""
-
update: ($image) ->
@redactor.image.hideResize()
@redactor.buffer.set()
$link = $image.closest('a')
@@ -83,11 +76,10 @@
@redactor.modal.close()
@redactor.observe.images()
@redactor.code.sync()
-
_show_edit: ($image) ->
$link = $image.closest('a')
@redactor.image.hideResize()
@redactor.modal.load('imageEdit', @redactor.lang.get('edit'), 705)
@@ -124,11 +116,10 @@
floatValue = if ($image.css('display') == 'block' && $image.css('float') == 'none') then 'center' else $image.css('float')
$('#redactor-image-align').val(floatValue)
@redactor.modal.show()
-
# for some reason when image is a link, tooltip is shown with the image edit dialog,
# add e.stopPropagation() to skip tooltip callback
_load_editable_controls: ($image) ->
imageBox =$ '<span id="redactor-image-box" data-redactor="verified">'
imageBox.css('float', $image.css('float')).attr('contenteditable', false)
@@ -158,9 +149,5 @@
# position correction
editerWidth = @redactor.image.editter.innerWidth()
@redactor.image.editter.css('margin-left', '-' + editerWidth/2 + 'px')
return @redactor.image.loadResizableControls($image, imageBox)
-
-
-
-