Skip to content

Commit

Permalink
FIX: 在编辑器没有 focus 时调整表格的列宽,所做调整没有被保存起来
Browse files Browse the repository at this point in the history
  • Loading branch information
biallo committed Jan 22, 2018
1 parent faf3af6 commit 06e8aee
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simditor",
"version": "2.3.10",
"version": "2.3.11",
"homepage": "http://simditor.tower.im/",
"authors": [
"farthinker <[email protected]>"
Expand Down
6 changes: 4 additions & 2 deletions lib/simditor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Simditor v2.3.10
* Simditor v2.3.11
* http://simditor.tower.im/
* 2018-01-22
*/
Expand Down Expand Up @@ -5112,8 +5112,9 @@ TableButton = (function(superClass) {
};

TableButton.prototype.initResize = function($table) {
var $colgroup, $resizeHandle, $wrapper;
var $colgroup, $editor, $resizeHandle, $wrapper;
$wrapper = $table.parent('.simditor-table');
$editor = this.editor;
$colgroup = $table.find('colgroup');
if ($colgroup.length < 1) {
$colgroup = $('<colgroup/>').prependTo($table);
Expand Down Expand Up @@ -5188,6 +5189,7 @@ TableButton = (function(superClass) {
return $handle.css('left', startHandleLeft + deltaX);
});
$(document).one('mouseup.simditor-resize-table', function(e) {
$editor.sync();
$(document).off('.simditor-resize-table');
return $wrapper.removeClass('resizing');
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simditor",
"version": "2.3.10",
"version": "2.3.11",
"description": "A simple online editor",
"keywords": "editor simditor",
"repository": {
Expand Down
4 changes: 3 additions & 1 deletion site/assets/scripts/simditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5107,8 +5107,9 @@ TableButton = (function(superClass) {
};

TableButton.prototype.initResize = function($table) {
var $colgroup, $resizeHandle, $wrapper;
var $colgroup, $editor, $resizeHandle, $wrapper;
$wrapper = $table.parent('.simditor-table');
$editor = this.editor;
$colgroup = $table.find('colgroup');
if ($colgroup.length < 1) {
$colgroup = $('<colgroup/>').prependTo($table);
Expand Down Expand Up @@ -5183,6 +5184,7 @@ TableButton = (function(superClass) {
return $handle.css('left', startHandleLeft + deltaX);
});
$(document).one('mouseup.simditor-resize-table', function(e) {
$editor.sync();
$(document).off('.simditor-resize-table');
return $wrapper.removeClass('resizing');
});
Expand Down
2 changes: 2 additions & 0 deletions src/buttons/table.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class TableButton extends Button

initResize: ($table) ->
$wrapper = $table.parent '.simditor-table'
$editor = @editor

$colgroup = $table.find 'colgroup'
if $colgroup.length < 1
Expand Down Expand Up @@ -175,6 +176,7 @@ class TableButton extends Button
$handle.css 'left', startHandleLeft + deltaX

$(document).one 'mouseup.simditor-resize-table', (e) ->
$editor.sync()
$(document).off '.simditor-resize-table'
$wrapper.removeClass 'resizing'

Expand Down
2 changes: 1 addition & 1 deletion styles/simditor.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Simditor v2.3.10
* Simditor v2.3.11
* http://simditor.tower.im/
* 2018-01-22
*/
Expand Down

0 comments on commit 06e8aee

Please sign in to comment.