Skip to content
Permalink
Browse files

Implement select2 input

  • Loading branch information...
marcelkooi committed Apr 17, 2019
1 parent e99d44c commit a12c45958d419a251cfca689ebe1db99cd4bb7ac
@@ -1,5 +1,5 @@
[holomapping]
root = "css"
root = "dist/css"
files = [
"select2.css"
]
@@ -1,6 +1,6 @@
[holomapping]
root = "js"
root = "dist/js"
files = [
"select2.js"
]
after = [ "skeleton-v2" ]
after = [ "skeleton-v2" ]
@@ -4,6 +4,7 @@
*}
{cssmin array(
'lib/bootstrap.css',
'lib/select2.css',
'plugins/*',
'laddr/*',
'branding/*'
@@ -9,6 +9,7 @@
"lib/typeahead.bundle.js",
"lib/bootstrap-combobox.js",
"lib/bootstrap-tagsinput.js",
"lib/select2.js",
"features/site-search.js",
"features/site-search-renderers/*",
"features/tooltips.js"
@@ -55,6 +55,13 @@
<label for="field-chat-channel">{_ "Chat Channel/Hashtag"}:</label>
<input name="ChatChannel" id="field-chat-channel" class="form-control" placeholder="train_schedule_analyzer" value="{refill field=ChatChannel default=$Project->ChatChannel}" pattern="[A-Za-z0-9_-]+" title="Hash tag containing only letters, numbers, dashes or underscores without leading #"/>
</div>

<!-- <select class="form-control select2-tags" multiple="multiple">
<option selected="selected">orange</option>
<option>white</option>
<option>purple</option>
</select> -->

<div class="form-group">
<label for="topicTagsInput">{_ 'Topic Tags'}:</label>
<input type="tags" data-tag-prefix="topic" id="topicTagsInput" class="form-control" name="tags[topic]" placeholder="{_ 'Education, Mapping, Crime'}" value="{refill field=tags.topic default=Tag::getTagsString($Project->Tags, topic)}"/>
@@ -3,6 +3,7 @@
markdownStr = $textarea.text(),
$readmeEditorCt = $('<div class="markdown-editor readme"></div>'),
$hiddenInput = $('<input type="hidden" name="README">'),
$select2TagsInput = $('.select2-tags'),
readmeEditor;

// replace textarea with container div and hidden input
@@ -26,4 +27,8 @@
$hiddenInput.closest('form').submit(function(event) {
$hiddenInput.val(readmeEditor.exportFile());
});
})();

$select2TagsInput.select2({
tags: true
});
})();

0 comments on commit a12c459

Please sign in to comment.
You can’t perform that action at this time.