Skip to content

Commit

Permalink
Merge pull request #1509 from ushahidi/develop
Browse files Browse the repository at this point in the history
Bugfix, editor for field-descriptions
  • Loading branch information
Angamanga authored Apr 21, 2020
2 parents 0fb682e + 7be8477 commit 3d02aa0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 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
6 changes: 2 additions & 4 deletions sass/vendor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
@import "~leaflet.markercluster/dist/MarkerCluster.Default";
@import "~leaflet.locatecontrol/src/L.Control.Locate";
@import "~nvd3/build/nv.d3";
@import '~tui-editor/dist/tui-editor.css'; // editor's ui
@import '~tui-editor/dist/tui-editor-contents.css'; // editor's content
@import '~codemirror/lib/codemirror.css'; // codemirror
@import '~highlight.js/styles/github.css'; // code block highlight
@import '~@toast-ui/editor/dist/toastui-editor-viewer.css'; // editor's ui
@import '~@toast-ui/editor/dist/toastui-editor.css'; // editor's content


// Custom overrides
Expand Down

0 comments on commit 3d02aa0

Please sign in to comment.