Skip to content

Commit

Permalink
Add new method getActiveViewWithOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
vash15 committed Nov 22, 2016
1 parent eb1541d commit eed4862
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,19 @@ Return the last view.

### getViewActive
Return the active view.
Ritorna la view attiva. It can be active only one view.

## getActiveViewWithOptions
Return an object

```
{
"view": `instance of Backbone.View`,
"options": {
animated: true,
...
}
}
```

### getViewAtIndex(index)
Return the view at index.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone.viewstack",
"version": "2.2.1",
"version": "2.3.0",
"homepage": "https://github.com/vash15/backbone.viewstack",
"authors": [
"Michele Belluco <[email protected]>",
Expand Down
4 changes: 4 additions & 0 deletions lib/viewstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
return this._current;
},

getActiveViewWithOptions: function getActiveViewWithOptions() {
return this._stack[ this._stack.length-1 ];
},

getViewAtIndex: function getViewAtIndex(index){
var element = this._stack[index];
if ( _.isObject(element) )
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone.viewstack",
"version": "2.2.1",
"version": "2.3.0",
"description": "View stack for Backbone",
"main": "lib/viewstack.js",
"repository": {
Expand Down

0 comments on commit eed4862

Please sign in to comment.