Skip to content

Commit

Permalink
MID-6271 ace editor hopefully fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed May 2, 2022
1 parent 5b99592 commit bec6301
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 35 deletions.
49 changes: 17 additions & 32 deletions gui/admin-gui/src/frontend/js/ace-editor.js
Expand Up @@ -6,7 +6,7 @@
*/

var ACE_EDITOR_POSTFIX = "_editor";
// var DISABLED_CLASS = "disabled";
var DISABLED_CLASS = "disabled";
$.aceEditors = {};

export default class MidPointAceEditor {
Expand Down Expand Up @@ -38,39 +38,26 @@ export default class MidPointAceEditor {
enableLiveAutocompletion: true,
selectionStyle: "text",
useSoftTabs: true,
tabSize: 3,
showPrintMargin: false,
fadeFoldWidgets: false,
});

// editor.setShowPrintMargin(false);
// editor.setFadeFoldWidgets(false);
// setReadonly(jqEditor, editor, readonly);
// editor.on('blur', function () {
// $(jqTextArea).val(editor.getSession().getValue());
// $(jqTextArea).trigger('blur');
// });
// editor.on('change', function () {
// $(jqTextArea).val(editor.getSession().getValue());
// $(jqTextArea).trigger('change');
// });
//
// //add editor to global map, so we can find it later
this.setReadonly(jqEditor, editor, readonly);

editor.on('blur', function () {
$(jqTextArea).val(editor.getSession().getValue());
$(jqTextArea).trigger('blur');
});
editor.on('change', function () {
$(jqTextArea).val(editor.getSession().getValue());
$(jqTextArea).trigger('change');
});

// add editor to global map, so we can find it later
$.aceEditors[editorId] = editor;
//
// //todo handle readonly for text area [lazyman] add "disabled" class to .ace_scroller

// $(document).ready(function () {
//
// var self = this;
//
// if (height < minHeight) {
// height = minHeight;
// }
//
// if (resize) {
// self.resizeToMaxHeight(editorId, minHeight);
// } else {
// self.resizeToFixedHeight(editorId, height);
// }
// });
// //todo handle readonly for text area [lazyman] add "disabled" class to .ace_scroller
}

resizeToMaxHeight(editorId, minHeight) {
Expand Down Expand Up @@ -140,6 +127,4 @@ export default class MidPointAceEditor {
$(jqEditor).removeClass(DISABLED_CLASS);
}
}

}

4 changes: 1 addition & 3 deletions gui/admin-gui/webpack.common.js
Expand Up @@ -23,7 +23,7 @@ module.exports = {
},
output: {
path: path.resolve(__dirname, 'target/generated-resources/webpack/static/static'),
publicPath: '../static/',
publicPath: '../../static/',
filename: './[name].js',
assetModuleFilename: './[name][ext]',
},
Expand Down Expand Up @@ -52,7 +52,6 @@ module.exports = {
loader: "./node_modules/babel-loader"
}
},

// Images: Copy image files to build folder
{
test: /\.(?:ico|gif|png|jpg|jpeg)$/i,
Expand All @@ -61,7 +60,6 @@ module.exports = {
filename: 'img/[name][ext]'
}
},

// Fonts and SVGs: Inline files
{
test: /\.(woff(2)?|eot|ttf|otf|svg|)$/,
Expand Down

0 comments on commit bec6301

Please sign in to comment.