aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/jot-header.tpl
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-02-26 09:51:40 +0000
committerMario <mario@mariovavti.com>2020-02-26 09:51:40 +0000
commite7f25b84664c158343621c391b8653042d5be53c (patch)
tree70e86ba68f7345ad1375b43bb8b38aafab089523 /view/tpl/jot-header.tpl
parentb36eb9a91cba1a6f3a53961f895665a0ae110b95 (diff)
downloadvolse-hubzilla-e7f25b84664c158343621c391b8653042d5be53c.tar.gz
volse-hubzilla-e7f25b84664c158343621c391b8653042d5be53c.tar.bz2
volse-hubzilla-e7f25b84664c158343621c391b8653042d5be53c.zip
implement poll UI in jot
Diffstat (limited to 'view/tpl/jot-header.tpl')
-rwxr-xr-xview/tpl/jot-header.tpl19
1 files changed, 19 insertions, 0 deletions
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index 7b1f4ee05..d519fd666 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -58,6 +58,9 @@ var activeCommentText = '';
$('#id_mimetype').on('load', jotSetMime);
$('#id_mimetype').on('change', jotSetMime);
+ $('#jot-add-option').on('click', jotAddOption);
+ $(document).on('click', '.poll-option-close', jotRemoveOption);
+
function jotSetMime() {
var mtype = $('#id_mimetype').val();
if(mtype == 'text/bbcode')
@@ -122,6 +125,7 @@ var activeCommentText = '';
activeCommentID = 0;
},
});
+
});
function deleteCheckedItems() {
@@ -309,6 +313,7 @@ var activeCommentText = '';
function itemCancel() {
$("#jot-title").val('');
$("#profile-jot-text").val('');
+ $(".jot-poll-option input").val('');
$("#jot-category").tagsinput('removeAll');
postSaveChanges('clean');
@@ -317,6 +322,7 @@ var activeCommentText = '';
$(".jothidden").hide();
$("#profile-jot-text").removeClass('jot-expanded');
$("#profile-jot-tools").addClass('d-none');
+ $("#jot-poll-wrap").addClass('d-none');
$("#jot-preview-content").html('').hide();
editor = false;
{{else}}
@@ -512,6 +518,19 @@ var activeCommentText = '';
}
+ function initPoll() {
+ $('#jot-poll-wrap').toggleClass('d-none');
+ }
+
+ function jotAddOption() {
+ var option = '<div class="jot-poll-option form-group"><input class="w-100 border-0" name="poll_answers[]" type="text" value="" placeholder="Option"><div class="poll-option-close"><i class="fa fa-close"></i></div></div>';
+ $('#jot-poll-options').append(option);
+ }
+
+ function jotRemoveOption(e) {
+ $(this).closest('.jot-poll-option').remove();
+ }
+
</script>
<script>