Sha256: bd56cba826225c5239c8a7b28ba7ccdf0b31c8f5e85432efdc1194ea05f2c9a7
Contents?: true
Size: 1.48 KB
Versions: 6
Compression:
Stored size: 1.48 KB
Contents
class @TypeStation.AdminBarEditor constructor: (@ts, @$el, @data) -> template = @$el.html() $('#ts-admin-bar').remove() $('#ts-admin-bar-edit').remove() $('body').append(template) vex.defaultOptions.className = 'vex-theme-os' $('#ts-admin-bar-edit').on 'click', => @ts.enable() false $('#ts-admin-bar-cancel').on 'click', => @ts.disable() if @ts.isChanged() vex.dialog.confirm message: 'You have unsaved changes, Do you want to discard them?' callback: (value) -> if value window.location.reload() false $('#ts-admin-bar-save').on 'click', => vex.dialog.confirm message: 'Are you sure you want to save changes?' callback: (value) => if value @ts.save() false $titleEditor = $('#ts-admin-bar-title') if $titleEditor.length > 0 editor = new TypeStation.TextHtmlEditor(@ts, $titleEditor, $titleEditor.data('ts')) @ts.editors.set $titleEditor.attr('id'), editor $editEditor = $('#ts-admin-bar-settings') if $editEditor.length > 0 editor = new TypeStation.EntityEditor(@ts, $editEditor, $editEditor.data('ts')) @ts.editors.set $editEditor.attr('id'), editor enable: -> $('#ts-admin-bar').removeClass('ts-hidden') $('#ts-admin-bar-edit').addClass('ts-hidden') disable: -> $('#ts-admin-bar').addClass('ts-hidden').removeClass 'insert-open' $('#ts-admin-bar-edit').removeClass('ts-hidden')
Version data entries
6 entries across 6 versions & 1 rubygems