Commit b200127f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

improve usability so that key events are not too much taken by spreadsheet.

parent e34f05b0
......@@ -267,7 +267,10 @@
var spreadsheet = data.spreadsheet;
if (spreadsheet !== undefined) {
var sheet = $('.jQuerySheet');
sheet.html($.sheet.dts.toTables.json(spreadsheet)).sheet();
sheet.html($.sheet.dts.toTables.json(spreadsheet)).sheet({
autoAddCells: false
});
sheet.getSheet().setNav(false);
}
var preference = data.preference !== undefined ?
......
......@@ -109,12 +109,20 @@
priv.initSpreadSheet = function () {
var sheet = $('.jQuerySheet');
$.get('spreadsheet_template.html', function (data) {
sheet.html(data).sheet();
sheet.html(data).sheet({
autoAddCells: false
});
sheet.getSheet().setNav(false);
// Here we bind on the parent object because bind will be
// reset when we replace the contents by using html().
$('#spreadsheet').bind('sheetCellEdited', function () {
priv.onDataChange();
});
// When we click outside of the
// spreadsheet, keyevent should not be taken by spreadsheet.
$(document).mousedown(function () {
$('.jQuerySheet').getSheet().setNav(false);
});
});
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment