Sha256: 167b056ca5dd66c8103437196a729a6ba13a6e785b3af93bc180556fe8eb3359
Contents?: true
Size: 1.9 KB
Versions: 20
Compression:
Stored size: 1.9 KB
Contents
= simple_form_for [:admin, :frontend, @function] do |f| .container .row .col-lg-2 = link_to admin_frontend_functions_path, "data-position" => "bottom", "data-tooltip" => t("keppler.actions.back") do .arrow-back.btn.btn-default %i.fa.fa-angle-left = t('keppler.actions.back') .container .nav-tabs-custom %ul.nav.nav-tabs %li.active %a{'aria-expanded': "true", "data-toggle" => "tab", :href => "#tab_1"} = "#{@function.name}" .kf-signal.function_signal %li.pull-right %a{onclick: "codeFunction.save(#{@function.id})", title: t('keppler.actions.save')} %i.fa.fa-save %li.pull-right = link_to admin_frontend_functions_path do %i.fa.fa-list %span.hidden-xs = t('keppler.actions.function_list') .tab-content #tab_1.tab-pane.active %div.html.code-container %textarea#code-function{name: "code"} = @function.function_code :javascript var tab = `#{@function.name}`; var id = `#{@function.id}`; var code = `#{@function.function_code}`; var ready = { action: false } $(document).ready(function() { if(code === $("#code-function").val()) { $('.function_signal').css('display', 'none'); } else { $('.function_signal').css('display', 'block'); } }) $(document).bind('keydown', function(e) { if(e.ctrlKey && (e.which == 83)) { e.preventDefault(); save() } }); function save() { if ( tab === `#{@function.name}`) { $('.function_signal').css('display', 'none'); codeFunction.save(id); } } codeFunction.codeMirrorFunction(); $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { tab = $(this)[0].innerText if ( tab === `#{@function.name}` && ready.action === false ) { codeFunction.codeMirrorFunction(); ready.action = true; } })
Version data entries
20 entries across 20 versions & 1 rubygems