Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Small fixes and feature additions #337

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/bootstrap-treeview.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "bootstrap-treeview",
"description": "Tree View for Twitter Bootstrap",
"version": "1.2.0",
"version": "1.2.3",
"homepage": "https://github.com/jonmiles/bootstrap-treeview",
"author": {
"name": "Jonathan Miles"
},
"repository": {
"type": "git",
"url": "git://github.com/jonmiles/bootstrap-treeview.git"
"url": "git://github.com/csgsolutions/bootstrap-treeview.git"
},
"bugs": {
"url": "https://github.com/jonmiles/bootstrap-treeview/issues"
"url": "https://github.com/csgsolutions/bootstrap-treeview/issues"
},
"licenses": [
{
"type": "Apache",
"url": "https://github.com/jonmiles/bootstrap-treeview/blob/master/LICENSE"
"url": "https://github.com/csgsolutions/bootstrap-treeview/blob/master/LICENSE"
}
],
"main": [
Expand Down
18 changes: 17 additions & 1 deletion public/js/bootstrap-treeview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* =========================================================
* bootstrap-treeview.js v1.2.0
* bootstrap-treeview.js v1.2.3
* =========================================================
*
* Fork of bootstrap-treeview by Jonathan Miles by CSG
* Copyright 2016 CSG
* Project URL: https://github.com/csgsolutions/bootstrap-treeview
*
* Copyright 2013 Jonathan Miles
* Project URL : http://www.jondmiles.com/bootstrap-treeview
*
Expand Down Expand Up @@ -112,6 +117,7 @@
getUnchecked: $.proxy(this.getUnchecked, this),
getDisabled: $.proxy(this.getDisabled, this),
getEnabled: $.proxy(this.getEnabled, this),
findNode: $.proxy(this.findNode, this),

// Select methods
selectNode: $.proxy(this.selectNode, this),
Expand Down Expand Up @@ -189,6 +195,7 @@
Tree.prototype.unsubscribeEvents = function () {

this.$element.off('click');
this.$element.off('nodeClicked');
this.$element.off('nodeChecked');
this.$element.off('nodeCollapsed');
this.$element.off('nodeDisabled');
Expand Down Expand Up @@ -322,6 +329,15 @@
var node = this.findNode(target);
if (!node || node.state.disabled) return;

var clickEvent = jQuery.Event("nodeClicked", {
target: event.target,
});
this.$element.trigger(clickEvent, $.extend(true, {}, node));

if (clickEvent.isDefaultPrevented()){
return;
}

var classList = target.attr('class') ? target.attr('class').split(' ') : [];
if ((classList.indexOf('expand-icon') !== -1)) {

Expand Down
18 changes: 17 additions & 1 deletion src/js/bootstrap-treeview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* =========================================================
* bootstrap-treeview.js v1.2.0
* bootstrap-treeview.js v1.2.3
* =========================================================
*
* Fork of bootstrap-treeview by Jonathan Miles by CSG
* Copyright 2016 CSG
* Project URL: https://github.com/csgsolutions/bootstrap-treeview
*
* Copyright 2013 Jonathan Miles
* Project URL : http://www.jondmiles.com/bootstrap-treeview
*
Expand Down Expand Up @@ -112,6 +117,7 @@
getUnchecked: $.proxy(this.getUnchecked, this),
getDisabled: $.proxy(this.getDisabled, this),
getEnabled: $.proxy(this.getEnabled, this),
findNode: $.proxy(this.findNode, this),

// Select methods
selectNode: $.proxy(this.selectNode, this),
Expand Down Expand Up @@ -189,6 +195,7 @@
Tree.prototype.unsubscribeEvents = function () {

this.$element.off('click');
this.$element.off('nodeClicked');
this.$element.off('nodeChecked');
this.$element.off('nodeCollapsed');
this.$element.off('nodeDisabled');
Expand Down Expand Up @@ -322,6 +329,15 @@
var node = this.findNode(target);
if (!node || node.state.disabled) return;

var clickEvent = jQuery.Event("nodeClicked", {
target: event.target,
});
this.$element.trigger(clickEvent, $.extend(true, {}, node));

if (clickEvent.isDefaultPrevented()){
return;
}

var classList = target.attr('class') ? target.attr('class').split(' ') : [];
if ((classList.indexOf('expand-icon') !== -1)) {

Expand Down
18 changes: 17 additions & 1 deletion tests/lib/bootstrap-treeview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* =========================================================
* bootstrap-treeview.js v1.2.0
* bootstrap-treeview.js v1.2.3
* =========================================================
*
* Fork of bootstrap-treeview by Jonathan Miles by CSG
* Copyright 2016 CSG
* Project URL: https://github.com/csgsolutions/bootstrap-treeview
*
* Copyright 2013 Jonathan Miles
* Project URL : http://www.jondmiles.com/bootstrap-treeview
*
Expand Down Expand Up @@ -112,6 +117,7 @@
getUnchecked: $.proxy(this.getUnchecked, this),
getDisabled: $.proxy(this.getDisabled, this),
getEnabled: $.proxy(this.getEnabled, this),
findNode: $.proxy(this.findNode, this),

// Select methods
selectNode: $.proxy(this.selectNode, this),
Expand Down Expand Up @@ -189,6 +195,7 @@
Tree.prototype.unsubscribeEvents = function () {

this.$element.off('click');
this.$element.off('nodeClicked');
this.$element.off('nodeChecked');
this.$element.off('nodeCollapsed');
this.$element.off('nodeDisabled');
Expand Down Expand Up @@ -322,6 +329,15 @@
var node = this.findNode(target);
if (!node || node.state.disabled) return;

var clickEvent = jQuery.Event("nodeClicked", {
target: event.target,
});
this.$element.trigger(clickEvent, $.extend(true, {}, node));

if (clickEvent.isDefaultPrevented()){
return;
}

var classList = target.attr('class') ? target.attr('class').split(' ') : [];
if ((classList.indexOf('expand-icon') !== -1)) {

Expand Down