fixing js a bit
Oleg
committed Mar 27, 2012
commit d244812722de191ac437e3348e0094f3cdf8ed23
Showing 2
changed files with
11 additions
and 3 deletions
app/assets/javascripts/comfortable_mexican_sofa/application.js
+1
-1
| @@ | @@ -91,7 +91,7 @@ $.CMS = function(){ |
| elRTE.prototype.options.panels.sofa_style = ['bold', 'italic', 'underline']; | |
| elRTE.prototype.options.panels.sofa_alignment = ['justifyleft', 'justifycenter', 'justifyright']; | |
| elRTE.prototype.options.panels.sofa_format = ['formatblock']; | |
| - | elRTE.prototype.options.panels.sofa_copypaste = ['pasteformattext']; |
| + | elRTE.prototype.options.panels.sofa_copypaste = ['pastetext']; |
| elRTE.prototype.options.panels.sofa_links = ['sofa_link', 'unlink']; | |
| elRTE.prototype.options.toolbars.sofa = $.CMS.config.elRTE.toolbar; | |
app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.sofa_image.js
+10
-2
| @@ | @@ -16,8 +16,14 @@ |
| // attaching event handlers to images | |
| $(document).on('click', '#cms_dialog .uploaded_files .file_info', function(){ | |
| - | self.img_src = $(this).data('url'); |
| - | self.set(); |
| + | console.log($(this)) |
| + | console.log($(this).parents('#cms_dialog')) |
| + | ui_control = $(this).parents('#cms_dialog').data('ui_control') |
| + | if (ui_control) { |
| + | ui_control.img_src = $(this).data('url'); |
| + | ui_control.set(); |
| + | $(this).parents('#cms_dialog').data('ui_control', null) |
| + | } |
| return false; | |
| }); | |
| @@ | @@ -46,6 +52,8 @@ |
| success: function(data){ | |
| self.dialog.html(data); | |
| self.dialog.dialog('open'); | |
| + | console.log($(self.dialog)) |
| + | $(self.dialog).data('ui_control', self) |
| $.CMS.enable_uploader(); | |
| } | |
| }) | |