From 9bf83a57bdbf4bc4d2ce53852c625506690f11f7 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 29 Jan 2018 18:43:20 -0800 Subject: don't show jot bb-edit buttons if a mimetype other than text/bbcode is selected (:todo: also disable bbcode autocomplete) --- view/tpl/jot-header.tpl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index ffaa4e208..0ffc8b349 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -110,10 +110,21 @@ var activeCommentID = 0; var activeCommentText = ''; $(document).ready(function() { + /* enable tinymce on focus and click */ $("#profile-jot-text").focus(enableOnUser); $("#profile-jot-text").click(enableOnUser); + $('#id_mimetype').on('load', jotSetMime); + $('#id_mimetype').on('change', jotSetMime); + + function jotSetMime() { + var mtype = $('#id_mimetype').val(); + if(mtype == 'text/bbcode') + $('#profile-jot-submit-left').show(); + else + $('#profile-jot-submit-left').hide(); + } $('#invisible-wall-file-upload').fileupload({ url: 'wall_attach/{{$nickname}}', -- cgit v1.2.3