Skip to content

Commit

Permalink
Merge pull request #1502 from ushahidi/fix-tui-editor
Browse files Browse the repository at this point in the history
fix(md-editor): Migrating to Toast-editor 2.0.1
  • Loading branch information
AmTryingMyBest authored Apr 20, 2020
2 parents 8888133 + 5d79d5f commit 40014f6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ angular.module('app',
return require('sortablejs/Sortable');
})
.factory('Editor', function () {
return require('tui-editor');
return require('@toast-ui/editor');
})
// inject the router instance into a `run` block by name
//.run(['$uiRouter', '$trace', '$location', function ($uiRouter, $trace, $location) {
Expand Down
4 changes: 2 additions & 2 deletions app/settings/surveys/attribute-editor.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function (
usageStatistics: false
});

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

$scope.save = function (editAttribute, activeTask) {
editAttribute.instructions = $scope.editor.getValue();
editAttribute.instructions = $scope.editor.getMarkdown();
if (!$scope.attributeLabel.$invalid) {
$scope.editAttribute.label = $scope.label;
$scope.addNewAttribute(editAttribute, activeTask);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"webpack-hot-middleware": "^2.25.0"
},
"dependencies": {
"@toast-ui/editor": "2.0.1",
"@uirouter/angularjs": "^1.0.10",
"URIjs": "^1.14.1",
"angular": "^1.5.6",
Expand Down Expand Up @@ -127,7 +128,6 @@
"raven-js": "^3.26.3",
"socket.io-client": "2.0.3",
"sortablejs": "1.10.0",
"tui-editor": "^1.4.7",
"underscore": "^1.7.0",
"ushahidi-platform-pattern-library": "^4.4.1"
},
Expand Down
6 changes: 5 additions & 1 deletion sass/overrides/_tui-markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@
// Fixes position and appearance of link-popup
.tui-popup-wrapper {
width: 250px;
left: 20%;
margin-left: -150px;
padding: 0px 10px 10px 10px !important;

&.te-heading-add {
margin-left: 10px;
}

.tui-popup-header {
padding: 10px 0px;
}
Expand Down

0 comments on commit 40014f6

Please sign in to comment.