Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
machuanjia committed Nov 28, 2015
1 parent ce6d68d commit e49135f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dist/all-min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/wt-editor-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wt-editor.tpl-min.js

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions src/css/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@
flex: 1;
-webkit-flex: 1;
overflow: auto;
display: flex;
display: -webkit-flex;

.wt-editor-textarea{
border: 0;
Expand All @@ -139,7 +137,7 @@
line-height: 18px;
padding: 30px 15px;
box-sizing: border-box;
flex: 1;
width: 100%;

&:focus {
border : 0;
Expand Down Expand Up @@ -179,7 +177,6 @@
border-left: 1px @layout-toolbar-border solid;
padding: 30px 15px;
box-sizing: border-box;
overflow: auto;
}

.link-box,.img-box{
Expand Down
18 changes: 11 additions & 7 deletions src/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ angular.module("wt-editor")
emojRegx : /\:[a-z0-9_\-\+]+\:/g
})
.controller('wtEditorCtrl', ['$scope','$timeout', 'wtEditorConfig', function ($scope,$timeout, wtEditorConfig) {

var mermaidError;
mermaid.parseError = function (err, hash) {
mermaidError = err;
};
//初始化甘特图
this.initGantt = function () {
mermaid.ganttConfig = {
Expand Down Expand Up @@ -531,7 +534,8 @@ angular.module("wt-editor")
emojiValue: '', //插入表情代码
faValue : '',
toolbars : [],
editorHeight : {overflow:'auto'},
editorHeight : {},
editorContainerCode:{},
header_action : false,
linkFlag:false,
linkStyle:{
Expand Down Expand Up @@ -907,7 +911,6 @@ angular.module("wt-editor")
vm.getContent = function(){
return vm.editor.value;
}

//监控modal变化
scope.$watch('value', function(newValue, oldValue) {
var __value = vm.editor.value;
Expand All @@ -920,6 +923,7 @@ angular.module("wt-editor")
$('#'+vm.focusId).focus()
},128);
}
vm.editorHeight.height = (vm.editor.scrollHeight+60)+'px';
});

//初始化完调用显示函数
Expand Down Expand Up @@ -952,7 +956,7 @@ angular.module("wt-editor")
left:_left+'px',
top:(_top)+'px'
}
vm.editorHeight.overflow="hidden";
vm.editorContainerCode.overflow="hidden";
}
//监控link变化
vm.setLinkText = function(){
Expand Down Expand Up @@ -997,7 +1001,7 @@ angular.module("wt-editor")
left:_left+'px',
top:_top+'px'
}
vm.editorHeight.overflow="hidden";
vm.editorContainerCode.overflow="hidden";
}

//监控link变化
Expand Down Expand Up @@ -1072,11 +1076,11 @@ angular.module("wt-editor")
scope.$apply(function(){
if(!_obj.hasClass('fa-link') && _obj.attr('flag') != 'link' && _obj.hasClass('textarea-mask')){
vm.linkFlag = false;
vm.editorHeight.overflow="auto";
vm.editorContainerCode.overflow="auto";
}
if(!_obj.hasClass('fa-image') && _obj.attr('flag') != 'img' && _obj.hasClass('textarea-mask')){
vm.imgFlag = false;
vm.editorHeight.overflow="auto";
vm.editorContainerCode.overflow="auto";
}
if(!_obj.hasClass('fa-header') && _obj.attr('flag') != 'h'){
vm.header_action = false;
Expand Down
2 changes: 1 addition & 1 deletion src/tpl/editor.html

Large diffs are not rendered by default.

0 comments on commit e49135f

Please sign in to comment.