Skip to content

Commit

Permalink
Merge pull request #12 from RaymondChao/refix35-ZSS-674
Browse files Browse the repository at this point in the history
Refix zss 674
  • Loading branch information
henrichen committed Jun 3, 2014
2 parents 0fa1995 + 1d97825 commit c6f97f0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
10 changes: 6 additions & 4 deletions zss/src/archive/web/js/zss/DataPanel.js
Expand Up @@ -483,14 +483,16 @@ zss.DataPanel = zk.$extends(zk.Object, {
}
} else { //when editing formula, always set focus back to editor

var sf = this;
setTimeout(function () {
//var sf = this;
//setTimeout(function () {
var info = sheet.editingFormulaInfo;
if (info) {
info.moveCell = true;
sf.getEditor(info.type).focus();
//sf.getEditor(info.type).focus();
// ZSS-674: use flag instead of setTimeout
sheet.shallIgnoreBlur = true;
}
});
//});
}
var fzr = sheet.frozenRow,
fzc = sheet.frozenCol,
Expand Down
9 changes: 7 additions & 2 deletions zss/src/archive/web/js/zss/Editbox.js
Expand Up @@ -64,12 +64,17 @@ Copyright (C) 2007 Potix Corporation. All Rights Reserved.
}
}

function blurEditor(wgt) {
function blurEditor (wgt) {
var sheet = wgt.sheet;
if (sheet) {
// ZSS-674: stay focused if formulabar's ok/cancel btn was pressed down.
if (sheet.shallIgnoreBlur) {
wgt.focus();
if (!zk.gecko) {
wgt.focus();
} else {
// 20140603, RaymondChao: firefox needs setTimeout to refocus when blur.
setTimeout(function () {wgt.focus()});
}
sheet.shallIgnoreBlur = false;
} else if (sheet.isSwitchingFocus) {
// 20140519, RaymondChao: when change focus between editors, spreadsheet could have no focus as below
Expand Down
4 changes: 3 additions & 1 deletion zss/src/archive/web/js/zss/SSheetCtrl.js
Expand Up @@ -2352,9 +2352,11 @@ zss.SSheetCtrl = zk.$extends(zk.Widget, {
clearTimeout(id);
}
this._fireCellSelectionId = setTimeout(function () {
self.fire('onCellSelection', {left: left, top: top, right: right, bottom: bottom});
//ZSS 171
// 20140603, RaymondChao: disable skip before fire onCellSelection to prevent
// editbox skiping to insert cell reference select at the first time
self._skipInsertCellRef = false;
self.fire('onCellSelection', {left: left, top: top, right: right, bottom: bottom});
}, 50);
},
/**
Expand Down

0 comments on commit c6f97f0

Please sign in to comment.