Skip to content

Commit

Permalink
first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewirts committed Jun 28, 2015
1 parent 24c2b5e commit f93490e
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 28 deletions.
20 changes: 18 additions & 2 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@
table.qtreedescription td:nth-child(2n) {
color: blue;
}
table.qtreedescription {
#qtreebuttons {
background: #CFD3DD;
}
#qtreebuttons img {
margin-left: 8px;
margin-top: 3px;
cursor: pointer;
}
#qtreedescription {
background: #CFD3DD;
}
.rotateHalf {
Expand Down Expand Up @@ -218,7 +226,9 @@ <h3>fin-hypergrid-behavior-qtree</h3>This element is a custom Polymer web compon
</div>
<core-splitter direction="up"></core-splitter>
<div flex class="rel">
<div class="abs" style="bottom:24px" id="qtreedescription">
<div class="abs" style="width:220px;bottom:24px" id="qtreebuttons">
</div>
<div class="abs" style="left:220px;bottom:24px" id="qtreedescription">
</div>
<div class="abs" style="top:24px">
<fin-hypergrid class="abs" id="qtree-example">
Expand Down Expand Up @@ -382,12 +392,18 @@ <h3>fin-hypergrid-behavior-gol</h3> This element is another custom Polymer web c
// return renderer;
// };
var descriptionPanel = document.querySelector('#qtreedescription');

var description = '';

setInterval(function(){
description = qTreeModel.getTreeStateDescription();
descriptionPanel.innerHTML = description;
}, 500);

setTimeout(function() {
var buttonPanel = document.querySelector('#qtreebuttons');
qTreeModel.setButtonBarHolder(buttonPanel);
},1000);
});

})();
Expand Down
76 changes: 63 additions & 13 deletions fin-hypergrid.dev.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion fin-hypergrid.min.html

Large diffs are not rendered by default.

Binary file added images/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/forth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/swap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions polymer/js/behaviors/Back
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Back
Collapse
Down
Expand
Forth
Pause
Reset
Swap
Up
18 changes: 13 additions & 5 deletions polymer/js/behaviors/fin-hypergrid-behavior-base.js

Large diffs are not rendered by default.

57 changes: 50 additions & 7 deletions polymer/js/behaviors/fin-hypergrid-behavior-qtree.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,13 @@
//clone[0] = clone[0] + ' ' + sortIndicator;
return clone;
} else {
if (this.isColumnReorderable()) {
return [this.getImage('collapse-all'), this.getImage('reset'), this.getImage('expand-all')];
//return [this.getImage('collapse-all'), '®', this.getImage('expand-all')];
} else {
return [this.getImage('empty'), this.getImage('reset'), this.getImage('empty')];
}
// if (this.isColumnReorderable()) {
// return [this.getImage('collapse-all'), this.getImage('reset'), this.getImage('expand-all')];
// //return [this.getImage('collapse-all'), '®', this.getImage('expand-all')];
// } else {
// return [this.getImage('empty'), this.getImage('reset'), this.getImage('empty')];
// }
return '';
}
},

Expand Down Expand Up @@ -1141,7 +1142,49 @@
}
result = result + '\n' + data + '</tr></table>';
return result;
}
},
setButtonBarHolder: function(buttonBarHolder) {
this.buttonBarHolder = buttonBarHolder;
this.initButtonBar();
},
initButtonBar: function() {
var self = this;
var image;
var bbh = this.buttonBarHolder;
if (!bbh) {
return;
}
bbh.innerHTML = '';

var action = function(name) {
return function() {
self.buttonBarIconClick(name);
};
};
var imageNames = Object.keys(this.block.buttons);

for (var i = 0; i < imageNames.length; i++) {
var name = imageNames[i];
image = this.getImage(name.toLowerCase()).cloneNode();
bbh.appendChild(image);
image.onclick = action(name);
}
},

/**
* @function
* @instance
* @description
button bar icon has been clicked
* @param {string} buttonLabel - button action alias to send to hypertree process
*/
buttonBarIconClick: function(buttonLabel) {
var bbClick = {
id: this.getNextMessageId(),
fn: buttonLabel
};
this.sendMessage(bbClick);
},

});

Expand Down

0 comments on commit f93490e

Please sign in to comment.