Skip to content

Commit

Permalink
https://github.com/Kademi/keditor/issues/189
Browse files Browse the repository at this point in the history
  • Loading branch information
ducdhm committed Jul 21, 2019
1 parent cd2cb08 commit 35ff8ca
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/js/keditor.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions src/keditor/constants/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@ export default {
*/
delete: 'Delete',

/*
* Text for snippet category label
* @option {String}
*/
snippetCategoryLabel: 'Category',

/*
* Text for snippet category "All"
* @option {String}
*/
snippetCategoryAll: 'All',

/*
* Text for snippet search text box
* @option {String}
*/
snippetCategorySearch: 'Type to search...',

/*
* Text title for container setting
* @option {String}
Expand Down
4 changes: 2 additions & 2 deletions src/keditor/snippet/initSnippetsFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export default function () {
let [categoriesOptions, filterWrapper] = renderSnippetFilter.call(self);

filterWrapper.html(`
<span class="${CSS_CLASS.UI} ${CSS_CLASS.SNIPPETS_FILTER_LABEL}">Category:</span>
<span class="${CSS_CLASS.UI} ${CSS_CLASS.SNIPPETS_FILTER_LABEL}">${options.locale.snippetCategoryLabel}:</span>
<select class="${CSS_CLASS.UI} ${CSS_CLASS.SNIPPETS_FILTER}">
${categoriesOptions}
</select>
<input type="text" class="${CSS_CLASS.UI} ${CSS_CLASS.SNIPPETS_SEARCH}" value="" placeholder="Type to search..." />
<input type="text" class="${CSS_CLASS.UI} ${CSS_CLASS.SNIPPETS_SEARCH}" value="" placeholder="${options.locale.snippetCategorySearch}" />
`);

let txtSearch = filterWrapper.find(`.${CSS_CLASS.SNIPPETS_SEARCH}`);
Expand Down
3 changes: 2 additions & 1 deletion src/keditor/snippet/renderSnippetFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import CSS_CLASS from '../constants/cssClass';

export default function () {
let self = this;
let options = self.options;
let modal = self.modal;

let categoriesOptions = `<option value="" selected="selected">All</option>`;
let categoriesOptions = `<option value="" selected="selected">${options.locale.snippetCategoryAll}</option>`;
$.each(self.categoryComponent, function (i, category) {
categoriesOptions += `<option value="${category}" class="${CSS_CLASS.SNIPPETS_FILTER_COMPONENT}">${category}</option>`;
});
Expand Down

0 comments on commit 35ff8ca

Please sign in to comment.