Skip to content

Commit

Permalink
Now fillTable needs to be manually called
Browse files Browse the repository at this point in the history
  • Loading branch information
afska committed Jan 27, 2017
1 parent 715e34b commit 9a45be7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
27 changes: 13 additions & 14 deletions dist/components/gs-board.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,7 @@
return "";
}
},
_initializeTable: function() {
var _ref;
if (this.table != null) {
return this.size = {
x: ((_ref = this.table[0]) != null ? _ref.length : void 0) || 0,
y: this.table.length || 0
};
} else {
this.table = [];
return this._fillTable();
}
},
_fillTable: function() {
fillTable: function() {
var i, j, limit, table, _base, _i, _j, _ref, _ref1;
if (this.table == null) {
return;
Expand All @@ -214,6 +202,18 @@
this.table = table.reverse();
return this._forceHeaderSet();
},
_initializeTable: function() {
var _ref;
if (this.table != null) {
return this.size = {
x: ((_ref = this.table[0]) != null ? _ref.length : void 0) || 0,
y: this.table.length || 0
};
} else {
this.table = [];
return this.fillTable();
}
},
_initializeOptions: function() {
var _base;
if (this.options == null) {
Expand All @@ -223,7 +223,6 @@
},
_updateSize: function() {
var _i, _ref, _results;
this._fillTable();
this.columnIndexes = (function() {
_results = [];
for (var _i = 0, _ref = this.size.x; 0 <= _ref ? _i < _ref : _i > _ref; 0 <= _ref ? _i++ : _i--){ _results.push(_i); }
Expand Down
2 changes: 1 addition & 1 deletion dist/gs-board.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gs-board",
"version": "1.1.12",
"version": "1.2.0",
"dependencies": {},
"devDependencies": {
"connect-livereload": "^0.4.0",
Expand Down
21 changes: 10 additions & 11 deletions src/components/gs-board/script.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ Polymer
boomCssClass: (boom) ->
if boom then "boom" else ""

_initializeTable: ->
if @table?
@size =
x: @table[0]?.length || 0
y: @table.length || 0
else
@table = []
@_fillTable()

_fillTable: ->
fillTable: ->
return if not @table?

limit = (array, limit) -> array.slice 0, limit
Expand All @@ -61,12 +52,20 @@ Polymer
@table = table.reverse()
@_forceHeaderSet()

_initializeTable: ->
if @table?
@size =
x: @table[0]?.length || 0
y: @table.length || 0
else
@table = []
@fillTable()

_initializeOptions: ->
@options ?= {}
@options.editable ?= false

_updateSize: ->
@_fillTable()
@columnIndexes = [0 ... @size.x]
@fire "board-changed"

Expand Down

0 comments on commit 9a45be7

Please sign in to comment.