app/views/bhf/entries/form/column/_markdown.haml in bhf-0.3.11 vs app/views/bhf/entries/form/column/_markdown.haml in bhf-0.4.0
- old
+ new
@@ -1,10 +1,10 @@
-# TODO: markdown editor
= node f, field do
- if @quick_edit
- = f.text_area field.name, :id => 'wmd-input', :class => 'markdown'
+ = f.text_area field.name, :class => 'markdown'
- else
= javascript_include_tag '/javascripts/bhf_includes/showdown.js'
#wmd-editor.wmd-pane
#wmd-button-bar
= f.text_area field.name, :id => 'wmd-input', :class => 'markdown'
@@ -15,14 +15,14 @@
#wmd-preview.wmd-panel
#wmd-output.wmd-panel.hide
= javascript_include_tag '/javascripts/bhf_includes/wmd.js'
:javascript
var toggleMdPreview = function(e){
- var a = e.target.id === 'toggle_html_preview';
- $('wmd-preview').toggleClass('hide', a);
- $('wmd-output').toggleClass('hide', !a);
- $('toggle_live_preview').toggleClass('active', !a);
- $('toggle_html_preview').toggleClass('active', a);
+ var htmlPreview = e.target.id === 'toggle_html_preview';
+ $('wmd-preview').toggleClass('hide', htmlPreview);
+ $('wmd-output').toggleClass('hide', !htmlPreview);
+ $('toggle_live_preview').toggleClass('active', !htmlPreview);
+ $('toggle_html_preview').toggleClass('active', htmlPreview);
};
$('toggle_live_preview').addEvent('click', toggleMdPreview);
$('toggle_html_preview').addEvent('click', toggleMdPreview);
\ No newline at end of file