Skip to content

Commit 3d02aa0

Browse files
authored
Merge pull request #1509 from ushahidi/develop
Bugfix, editor for field-descriptions
2 parents 0fb682e + 7be8477 commit 3d02aa0

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

app/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ angular.module('app',
153153
return require('sortablejs/Sortable');
154154
})
155155
.factory('Editor', function () {
156-
return require('tui-editor');
156+
return require('@toast-ui/editor');
157157
})
158158
// inject the router instance into a `run` block by name
159159
//.run(['$uiRouter', '$trace', '$location', function ($uiRouter, $trace, $location) {

app/settings/surveys/attribute-editor.directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function (
4040
usageStatistics: false
4141
});
4242

43-
$scope.editor.setValue($scope.editAttribute.instructions);
43+
$scope.editor.setMarkdown($scope.editAttribute.instructions);
4444
/** This is a hack to override the tui-editor's own inline-style
4545
* that makes the scroll get stuck inside the editor-area */
4646
let editor = document.querySelector('#editSection');
@@ -50,7 +50,7 @@ function (
5050
initiateEditor();
5151

5252
$scope.save = function (editAttribute, activeTask) {
53-
editAttribute.instructions = $scope.editor.getValue();
53+
editAttribute.instructions = $scope.editor.getMarkdown();
5454
if (!$scope.attributeLabel.$invalid) {
5555
$scope.editAttribute.label = $scope.label;
5656
$scope.addNewAttribute(editAttribute, activeTask);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"webpack-hot-middleware": "^2.25.0"
9595
},
9696
"dependencies": {
97+
"@toast-ui/editor": "2.0.1",
9798
"@uirouter/angularjs": "^1.0.10",
9899
"URIjs": "^1.14.1",
99100
"angular": "^1.5.6",
@@ -127,7 +128,6 @@
127128
"raven-js": "^3.26.3",
128129
"socket.io-client": "2.0.3",
129130
"sortablejs": "1.10.0",
130-
"tui-editor": "^1.4.7",
131131
"underscore": "^1.7.0",
132132
"ushahidi-platform-pattern-library": "^4.4.1"
133133
},

sass/overrides/_tui-markdown.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@
2525
// Fixes position and appearance of link-popup
2626
.tui-popup-wrapper {
2727
width: 250px;
28-
left: 20%;
28+
margin-left: -150px;
2929
padding: 0px 10px 10px 10px !important;
3030

31+
&.te-heading-add {
32+
margin-left: 10px;
33+
}
34+
3135
.tui-popup-header {
3236
padding: 10px 0px;
3337
}

sass/vendor.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
@import "~leaflet.markercluster/dist/MarkerCluster.Default";
1313
@import "~leaflet.locatecontrol/src/L.Control.Locate";
1414
@import "~nvd3/build/nv.d3";
15-
@import '~tui-editor/dist/tui-editor.css'; // editor's ui
16-
@import '~tui-editor/dist/tui-editor-contents.css'; // editor's content
17-
@import '~codemirror/lib/codemirror.css'; // codemirror
18-
@import '~highlight.js/styles/github.css'; // code block highlight
15+
@import '~@toast-ui/editor/dist/toastui-editor-viewer.css'; // editor's ui
16+
@import '~@toast-ui/editor/dist/toastui-editor.css'; // editor's content
1917

2018

2119
// Custom overrides

0 commit comments

Comments
 (0)