Skip to content

Commit

Permalink
SchemaEditor field editor dropdown fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzapp committed Aug 21, 2017
1 parent 3bd5560 commit 4fa1483
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 274 deletions.
16 changes: 6 additions & 10 deletions public/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -39996,7 +39996,7 @@ module.exports = ["address", "article", "aside", "blockquote", "canvas", "dd", "
module.exports = {
"name": "hashbrown-cms",
"repository": "https://github.com/Putaitu/hashbrown-cms.git",
"version": "0.9.1",
"version": "0.9.3",
"description": "The pluggable CMS",
"main": "hashbrown.js",
"scripts": {
Expand Down Expand Up @@ -45083,22 +45083,18 @@ var SchemaEditor = function (_View) {
var editor = HashBrown.Views.Editors.FieldEditors[i];

editorOptions[editorOptions.length] = {
value: editor.id,
value: editor.name,
label: editor.name
};
}

var editorName = '(none)';
var editorId = this.model.editorId;
// The editorId is actually a name more than an id
var editorName = this.model.editorId || '(none)';

// Backwards compatible check
editorId = editorId.charAt(0).toUpperCase() + editorId.slice(1);

if (HashBrown.Views.Editors.FieldEditors[editorId]) {
editorName = HashBrown.Views.Editors.FieldEditors[editorId].name;
}
editorName = editorName.charAt(0).toUpperCase() + editorName.slice(1);

var $element = _.div({ class: 'editor-picker' }, _.if(!this.model.isLocked, UI.inputDropdownTypeAhead(editorId, editorOptions, function (newValue) {
var $element = _.div({ class: 'editor-picker' }, _.if(!this.model.isLocked, UI.inputDropdownTypeAhead(editorName, editorOptions, function (newValue) {
_this3.model.editorId = newValue;
})), _.if(this.model.isLocked, _.p({ class: 'read-only' }, editorName)));

Expand Down
Loading

0 comments on commit 4fa1483

Please sign in to comment.