Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
release 3.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
interactivellama committed May 22, 2015
1 parent 0c6516a commit cc889bd
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 110 deletions.
6 changes: 3 additions & 3 deletions DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Fuel UX can be applied to a section of your your HTML or the entire page by addi
## Downloading code
Fuel UX can be obtained in any of the following ways:

* Request files from [the Fuel UX CDN](http://www.fuelcdn.com/fuelux/3.7.2/)
* Request files from [the Fuel UX CDN](http://www.fuelcdn.com/fuelux/3.7.3/)
* Using [Bower](https://github.com/bower/bower) (ensures you get all the [dependencies](#dependencies)):

```
Expand All @@ -53,7 +53,7 @@ Fuel UX can be obtained in any of the following ways:

Cloning the repository ensures you can apply future updates to Fuel UX easily, but requires to you manage its [dependencies](#dependencies) on your own.

* Download a .zip archive of the [latest release](http://www.fuelcdn.com/fuelux/3.7.2/fuelux.zip).
* Download a .zip archive of the [latest release](http://www.fuelcdn.com/fuelux/3.7.3/fuelux.zip).

## AMD support

Expand All @@ -63,7 +63,7 @@ If using AMD (such as [RequireJS](http://requirejs.org)), reference the FuelUX d
```javascript
require.config({
paths: {
'fuelux': 'http://www.fuelcdn.com/fuelux/3.7.2/'
'fuelux': 'http://www.fuelcdn.com/fuelux/3.7.3/'
//...
}
});
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ Add `fuelux` class to the portion of the page using Fuel UX as seen [here](https
Ensure all the dependencies are included on the page (eg, such as using the CDN as shown below).
```
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//www.fuelcdn.com/fuelux/3.7.2/css/fuelux.min.css" rel="stylesheet">
<link href="//www.fuelcdn.com/fuelux/3.7.3/css/fuelux.min.css" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.1/js/bootstrap.min.js"></script>
<script src="//www.fuelcdn.com/fuelux/3.7.2/js/fuelux.min.js"></script>
<script src="//www.fuelcdn.com/fuelux/3.7.3/js/fuelux.min.js"></script>
```

### Install
A few ways available to install.

- Request files from [the Fuel UX CDN](http://www.fuelcdn.com/fuelux/3.7.2/)
- Request files from [the Fuel UX CDN](http://www.fuelcdn.com/fuelux/3.7.3/)
- [Download the latest release](https://github.com/exacttarget/fuelux/archive/3.4.0.zip).
- Clone the repo: `git clone https://github.com/exacttarget/fuelux.git`.
- Install with [Bower](http://bower.io): `bower install fuelux`.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fuelux",
"description": "Extending Bootstrap with additional lightweight JavaScript controls.",
"version": "3.7.2",
"version": "3.7.3",
"keywords": [
"application",
"bootstrap",
Expand Down
4 changes: 2 additions & 2 deletions dist/css/fuelux.css

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

2 changes: 1 addition & 1 deletion dist/css/fuelux.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/css/fuelux.min.css

Large diffs are not rendered by default.

Binary file modified dist/fuelux.zip
Binary file not shown.
200 changes: 108 additions & 92 deletions dist/js/fuelux.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Fuel UX v3.7.2
* Fuel UX v3.7.3
* Copyright 2012-2015 ExactTarget
* Licensed under the BSD-3-Clause license (https://github.com/ExactTarget/fuelux/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -1488,6 +1488,8 @@
constructor: Loader,

destroy: function() {
this.pause();

this.$element.remove();
// any external bindings
// [none]
Expand Down Expand Up @@ -1963,15 +1965,15 @@
},

setCheckedState: function( element, checked ) {
// reset all items in group
this.resetGroup();

var $radio = element;
var $lbl = $radio.parent();
var containerSelector = $radio.attr( 'data-toggle' );
var $containerToggle = $( containerSelector );

if ( checked ) {
// reset all items in group
this.resetGroup();

$radio.prop( 'checked', true );
$lbl.addClass( 'checked' );
$containerToggle.removeClass( 'hide hidden' );
Expand Down Expand Up @@ -3018,6 +3020,16 @@
Tree.prototype = {
constructor: Tree,

deselectAll: function deselectAll( nodes ) {
// clear all child tree nodes and style as deselected
nodes = nodes || this.$element;
var $selectedElements = $( nodes ).find( '.tree-selected' );
$selectedElements.each( function( index, element ) {
styleNodeDeselected( $( element ), $( element ).find( '.glyphicon' ) );
} );
return $selectedElements;
},

destroy: function destroy() {
// any external bindings [none]
// empty elements to return to original markup
Expand Down Expand Up @@ -3117,59 +3129,41 @@
} );
},

selectItem: function selectItem( el ) {
if ( !this.options.itemSelect ) return;
var $el = $( el );
var selData = $el.data();
var $all = this.$element.find( '.tree-selected' );
var data = [];
var $icon = $el.find( '.icon-item' );
selectTreeNode: function selectItem( clickedElement, nodeType ) {
var clicked = {}; // object for clicked element
clicked.$element = $( clickedElement );

if ( this.options.multiSelect ) {
$.each( $all, function( index, value ) {
var $val = $( value );
if ( $val[ 0 ] !== $el[ 0 ] ) {
data.push( $( value ).data() );
}
} );
} else if ( $all[ 0 ] !== $el[ 0 ] ) {
$all.removeClass( 'tree-selected' )
.find( '.glyphicon' ).removeClass( 'glyphicon-ok' ).addClass( 'fueluxicon-bullet' );
data.push( selData );
}

var eventType = 'selected';
if ( $el.hasClass( 'tree-selected' ) ) {
eventType = 'deselected';
$el.removeClass( 'tree-selected' );
if ( $icon.hasClass( 'glyphicon-ok' ) || $icon.hasClass( 'fueluxicon-bullet' ) ) {
$icon.removeClass( 'glyphicon-ok' ).addClass( 'fueluxicon-bullet' );
}
var selected = {}; // object for selected elements
selected.$elements = this.$element.find( '.tree-selected' );
selected.dataForEvent = [];

// determine clicked element and it's icon
if ( nodeType === 'folder' ) {
// make the clicked.$element the container branch
clicked.$element = clicked.$element.closest( '.tree-branch' );
clicked.$icon = clicked.$element.find( '.icon-folder' );
} else {
$el.addClass( 'tree-selected' );
// add tree dot back in
if ( $icon.hasClass( 'glyphicon-ok' ) || $icon.hasClass( 'fueluxicon-bullet' ) ) {
$icon.removeClass( 'fueluxicon-bullet' ).addClass( 'glyphicon-ok' );
}

if ( this.options.multiSelect ) {
data.push( selData );
}
clicked.$icon = clicked.$element.find( '.icon-item' );
}
clicked.elementData = clicked.$element.data();

// the below functions pass objects by copy/reference and use modified object in this function
if ( this.options.multiSelect ) {
multiSelectSyncNodes( this, clicked, selected );
} else {
singleSelectSyncNodes( this, clicked, selected );
}

this.$element.trigger( eventType + '.fu.tree', {
target: selData,
selected: data
// all done with the DOM, now fire events
this.$element.trigger( selected.eventType + '.fu.tree', {
target: clicked.elementData,
selected: selected.dataForEvent
} );

// Return new list of selected items, the item
// clicked, and the type of event:
$el.trigger( 'updated.fu.tree', {
selected: data,
item: $el,
eventType: eventType
clicked.$element.trigger( 'updated.fu.tree', {
selected: selected.dataForEvent,
item: clicked.$element,
eventType: selected.eventType
} );
},

Expand Down Expand Up @@ -3228,52 +3222,16 @@
}
},

selectFolder: function selectFolder( clickedElement ) {
if ( !this.options.folderSelect ) return;
var $clickedElement = $( clickedElement );
var $clickedBranch = $clickedElement.closest( '.tree-branch' );
var $selectedBranch = this.$element.find( '.tree-branch.tree-selected' );
var clickedData = $clickedBranch.data();
var selectedData = [];
var eventType = 'selected';

// select clicked item
if ( $clickedBranch.hasClass( 'tree-selected' ) ) {
eventType = 'deselected';
$clickedBranch.removeClass( 'tree-selected' );
} else {
$clickedBranch.addClass( 'tree-selected' );
selectFolder: function selectFolder( el ) {
if ( this.options.folderSelect ) {
this.selectTreeNode( el, 'folder' );
}
},

if ( this.options.multiSelect ) {
// get currently selected
$selectedBranch = this.$element.find( '.tree-branch.tree-selected' );

$.each( $selectedBranch, function( index, value ) {
var $value = $( value );
if ( $value[ 0 ] !== $clickedElement[ 0 ] ) {
selectedData.push( $( value ).data() );
}
} );

} else if ( $selectedBranch[ 0 ] !== $clickedElement[ 0 ] ) {
$selectedBranch.removeClass( 'tree-selected' );

selectedData.push( clickedData );
selectItem: function selectItem( el ) {
if ( this.options.itemSelect ) {
this.selectTreeNode( el, 'item' );
}

this.$element.trigger( eventType + '.fu.tree', {
target: clickedData,
selected: selectedData
} );

// Return new list of selected items, the item
// clicked, and the type of event:
$clickedElement.trigger( 'updated.fu.tree', {
selected: selectedData,
item: $clickedElement,
eventType: eventType
} );
},

selectedItems: function selectedItems() {
Expand Down Expand Up @@ -3423,11 +3381,69 @@
}
};


// ALIASES

//alias for collapse for consistency. "Collapse" is an ambiguous term (collapse what? All? One specific branch?)
Tree.prototype.closeAll = Tree.prototype.collapse;
//alias for backwards compatibility because there's no reason not to.
Tree.prototype.openFolder = Tree.prototype.discloseFolder;


// PRIVATE FUNCTIONS

function styleNodeSelected( $element, $icon ) {
$element.addClass( 'tree-selected' );
if ( $element.data( 'type' ) === 'item' && $icon.hasClass( 'fueluxicon-bullet' ) ) {
$icon.removeClass( 'fueluxicon-bullet' ).addClass( 'glyphicon-ok' ); // make checkmark
}
}

function styleNodeDeselected( $element, $icon ) {
$element.removeClass( 'tree-selected' );
if ( $element.data( 'type' ) === 'item' && $icon.hasClass( 'glyphicon-ok' ) ) {
$icon.removeClass( 'glyphicon-ok' ).addClass( 'fueluxicon-bullet' ); // make bullet
}
}

function multiSelectSyncNodes( self, clicked, selected ) {
// search for currently selected and add to selected data list if needed
$.each( selected.$elements, function( index, element ) {
var $element = $( element );
if ( $element[ 0 ] !== clicked.$element[ 0 ] ) {
selected.dataForEvent.push( $( $element ).data() );
}
} );

if ( clicked.$element.hasClass( 'tree-selected' ) ) {
styleNodeDeselected( clicked.$element, clicked.$icon );
// set event data
selected.eventType = 'deselected';
} else {
styleNodeSelected( clicked.$element, clicked.$icon );
// set event data
selected.eventType = 'selected';
selected.dataForEvent.push( clicked.elementData );
}
}

function singleSelectSyncNodes( self, clicked, selected ) {
// element is not currently selected
if ( selected.$elements[ 0 ] !== clicked.$element[ 0 ] ) {
var clearedElements = self.deselectAll( self.$element );
styleNodeSelected( clicked.$element, clicked.$icon );
// set event data
selected.eventType = 'selected';
selected.dataForEvent = [ clicked.elementData ];
} else {
styleNodeDeselected( clicked.$element, clicked.$icon );
// set event data
selected.eventType = 'deselected';
selected.dataForEvent = [];
}
}


// TREE PLUGIN DEFINITION

$.fn.tree = function tree( option ) {
Expand Down
10 changes: 5 additions & 5 deletions dist/js/fuelux.min.js

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
Expand Up @@ -74,7 +74,7 @@
"test": "grunt travisci --verbose"
},
"title": "Fuel UX",
"version": "3.7.2",
"version": "3.7.3",
"volo": {
"baseDir": "lib",
"dependencies": {
Expand Down

0 comments on commit cc889bd

Please sign in to comment.