Skip to content

Commit

Permalink
Release v0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauris committed Feb 8, 2016
1 parent 9ccfe21 commit 1aa56ff
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 41 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "sensei-grid",
"version": "0.4.2",
"version": "0.4.3",
"homepage": "https://github.com/datazenit/sensei-grid",
"authors": [
"Lauris <lauris@discuss.lv>"
Expand Down
12 changes: 11 additions & 1 deletion dist/sensei-grid.css
@@ -1,5 +1,5 @@
/**
* sensei-grid v0.4.2
* sensei-grid v0.4.3
* Copyright (c) 2016 Lauris Dzilums <lauris@discuss.lv>
* Licensed under MIT
*/
Expand Down Expand Up @@ -219,4 +219,14 @@
}
.tt-suggestion p {
margin: 0;
}

.note-editor .note-resizebar {
display: none;
}
.note-editor.note-frame {
margin-bottom: 0;
border-style: none;
box-shadow: none;
-webkit-box-shadow: none;
}
52 changes: 36 additions & 16 deletions dist/sensei-grid.js
@@ -1,5 +1,5 @@
/**
* sensei-grid v0.4.2
* sensei-grid v0.4.3
* Copyright (c) 2016 Lauris Dzilums <lauris@discuss.lv>
* Licensed under MIT
*/
Expand Down Expand Up @@ -1377,6 +1377,15 @@
} else {
$(div).text(item[column.name]);
}

// custom style callback
if (_.isFunction(column.style)) {
var style = column.style(item[column.name], plugin);

if (!_.isEmpty(style)) {
$(td).css(style);
}
}
}

// check if nowrap needs to be disabled
Expand Down Expand Up @@ -1786,35 +1795,46 @@
this.getElement().css({width: $td.outerWidth() + 50});
},
getValue: function () {
return $(".summertime-wrapper", this.editor).code();
var htmlVal = $(".summertime-wrapper", this.editor).summernote("code");
return ("" + htmlVal).trim();
},
setValue: function (val) {
$(".summertime-wrapper", this.editor).destroy();
$(".summertime-wrapper", this.editor).html(val);

var grid = this.grid;

$(".summertime-wrapper", this.editor).summernote({
focus: true,
height: 100,
disableResizeEditor: true,
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough']],
['color', ['color']],
['fontsize', ['fontsize']]
],
onfocus: function () {
grid.preventEnter = true;
},
onblur: function () {
grid.preventEnter = false;
},
onkeydown: function (e) {
if (e.keyCode === 9) {
e.stopImmediatePropagation();
callbacks: {
onKeydown: function (e) {

// prevent enter + modifier keys in summernote
if (e.keyCode === 13 && (e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
e.preventDefault();
return true;
}

// allow only enter itself in summernote, prevent event to be triggered in grid
if (e.keyCode === 13) {
e.stopImmediatePropagation();
}

// prevent tab in summernote
if (e.keyCode === 9) {
e.preventDefault();
return false;
}

}
}
});

$(".summertime-wrapper", this.editor).code(val);
$(".summertime-wrapper", this.editor).summernote("code", val);
}
});

Expand Down
2 changes: 1 addition & 1 deletion dist/sensei-grid.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/sensei-grid.min.js

Large diffs are not rendered by default.

28 changes: 11 additions & 17 deletions examples/index.html
Expand Up @@ -14,7 +14,7 @@
<link rel="stylesheet" type="text/css" href="../lib/summernote/dist/summernote.css"/>

<!-- Sensei Grid CSS -->
<link rel="stylesheet" type="text/css" href="../src/css/sensei-grid.css?v=20160208021147"/>
<link rel="stylesheet" type="text/css" href="../src/css/sensei-grid.css?v=20160208080525"/>

<!-- Core JS dependencies -->
<script src="../lib/jquery/dist/jquery.min.js"></script>
Expand All @@ -29,10 +29,10 @@
<script src="../lib/typeahead.js/dist/typeahead.jquery.js"></script>

<!-- Sensei Grid JS -->
<script src="../src/sensei-grid.js?v=20160208021147"></script>
<script src="../src/sensei-editors.js?v=20160208021147"></script>
<script src="../src/sensei-row-actions.js?v=20160208021147"></script>
<script src="example.js?v=20160208021147"></script>
<script src="../src/sensei-grid.js?v=20160208080525"></script>
<script src="../src/sensei-editors.js?v=20160208080525"></script>
<script src="../src/sensei-row-actions.js?v=20160208080525"></script>
<script src="example.js?v=20160208080525"></script>

<!-- Custom CSS for this example -->
<style type="text/css">
Expand Down Expand Up @@ -90,11 +90,10 @@ <h1>Sensei Grid – JavaScript Data Grid</h1>

<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="active"><a href="#defaultdemo" role="tab" data-toggle="tab">Full demo</a></li>
<li><a href="#htmldemo" role="tab" data-toggle="tab">HTML in cells</a></li>
<li><a href="#styles" role="tab" data-toggle="tab">Custom cell styles</a></li>
<li><a href="#readonly" role="tab" data-toggle="tab">Read-only grid</a></li>
<li><a href="#rowactions" role="tab" data-toggle="tab">Row actions</a></li>
<li class="active"><a href="#defaultdemo" role="tab" data-toggle="tab">Full Demo</a></li>
<li><a href="#htmldemo" role="tab" data-toggle="tab">HTML in Grid Demo</a></li>
<li><a href="#readonly" role="tab" data-toggle="tab">Read-only Grid</a></li>
<li><a href="#rowactions" role="tab" data-toggle="tab">Row Actions</a></li>
</ul>
<br>
<!-- Tab panes -->
Expand All @@ -104,18 +103,13 @@ <h1>Sensei Grid – JavaScript Data Grid</h1>
</div>
<div role="tabpanel" class="tab-pane" id="htmldemo">
<div class="sensei-grid sensei-grid-html"></div>
<div class="alert alert-info">
This demo features WYSIWYG editor and HTML display in cells.
HTML can be allowed in cells by setting <code>allowHTML: true</code> in column
definition object. To add WYSIWYG editor, set "RichEditor" as column's editor.
<div class="alert alert-info">HTML can be allowed in cells by setting <code>allowHTML: true</code> in column
definition object.
</div>
</div>
<div role="tabpanel" class="tab-pane" id="readonly">
<div class="sensei-grid sensei-grid-readonly"></div>
</div>
<div role="tabpanel" class="tab-pane" id="styles">
<div class="sensei-grid sensei-grid-styles"></div>
</div>
<div role="tabpanel" class="tab-pane" id="rowactions">
<div class="sensei-grid sensei-grid-rowactions"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "sensei-grid",
"version": "0.4.2",
"version": "0.4.3",
"description": "Simple data grid in JavaScript/HTML.",
"main": "index.js",
"directories": {
Expand Down
2 changes: 0 additions & 2 deletions src/sensei-editors.js
Expand Up @@ -334,8 +334,6 @@
},
setValue: function (val) {

var grid = this.grid;

$(".summertime-wrapper", this.editor).summernote({
focus: true,
height: 100,
Expand Down

0 comments on commit 1aa56ff

Please sign in to comment.