Skip to content

Commit

Permalink
v3.1 docs (#3230)
Browse files Browse the repository at this point in the history
* Fix a docs linter error

* Document childViewEventPrefix: false

Also fix a couple of related link errors

* Document region destruction upon removal

* v3.1 changelog
  • Loading branch information
paulfalgout authored and denar90 committed Oct 12, 2016
1 parent 360d3b7 commit b0a7e92
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
25 changes: 25 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
### v3.1.0 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v3.0.0...v3.1.0)

#### General
* Performance optimizations for `triggerMethod`, `mergeOptions` and other internal event handlers
* Significant render and removal optimizations for CollectionView utilizing Backbone's `update` event

#### Features
* `Region.detachView` and `View.detachChildView` were added for removing a view from a region without destroying it. This is preferred to the now deprecated `preventDestroy` region show/empty option
* `childViewEventPrefix: false` will disable auto-proxying of child events to the parent view
* `Application` will now accept a region definition object literal as an instantiation option
* Regions are now destroyed when removed from a View

#### Fixes
* Fixed an issue with Lodash 4 compatibility related to behavior events

#### Deprecations
* Region `empty`'s `preventDestroy` option was deprecated in favor of `detachView`
* A region definition object literal's `selector` key was deprecated due to redundacy in favor of the existing key `el`

#### Misc
* Many documentation fixes for v3
* Removed shouldReplace logic from `attachHtml` so overriding no longer breaks `replaceElement` functionality
* Exposed `View.normalizeUIString` for external libraries
* Improvements were made for Views initialized with existing DOM elements

### v3.0.0

Version 3.0.0 of Marionette has arrived and contains many improvements over version
Expand Down
9 changes: 7 additions & 2 deletions docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ methods bound to the `childViewEvents` attribute. This works for built-in
events, custom events fired with `triggerMethod` and bound events using
`triggers`.

When using implicit listeners, the [`childview:*` event prefix](#childvieweventprefix) is used which
**Note**: Automatic event bubbling can be disabled by setting [`childViewEventPrefix`](#a-child-views-event-prefix) to `false`.

When using implicit listeners, the [`childview:*` event prefix](#a-child-views-event-prefix) is used which
needs to be included as part of the handler:

```javascript
Expand Down Expand Up @@ -301,7 +303,10 @@ Just like with the `View` and its regions, the event handler will receive the
You can customize the event prefix for events that are forwarded
through the view. To do this, set the `childViewEventPrefix`
on the view or collectionview. For more information on the `childViewEventPrefix` see
[Event bubbling](#childview-event-bubbling-from-child-views)
[Event bubbling](#event-bubbling).

The default value for `childViewEventPrefix` is `childview`. Setting this property to
`false` will disable [automatic event bubbling](#event-bubbling).

```javascript
var Bb = require('backbone');
Expand Down
4 changes: 2 additions & 2 deletions docs/marionette.application.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var App = Mn.Application.extend({
},

onBeforeStart: function() {
this.model = new MyModel(this.options.data);
this.model = new MyModel(this.options.data);
},

onStart: function() {
Expand Down Expand Up @@ -168,7 +168,7 @@ var App = Mn.Application.extend({
},

onBeforeStart: function(app, options) {
this.model = new MyModel(options.data);
this.model = new MyModel(options.data);
},

onStart: function(app, options) {
Expand Down
6 changes: 4 additions & 2 deletions docs/marionette.region.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ myView.addRegions({

### Removing Regions

You can remove all of the regions from a view by calling `removeRegions` or you can remove a region by name using `removeRegion`.
You can remove all of the regions from a view by calling `removeRegions` or you can remove a region by name using `removeRegion`. When a region is removed the region will be destroyed.

```javascript
var Mn = require('backbone.marionette');
Expand All @@ -196,7 +196,9 @@ var MyView = Mn.View.extend({
var myView = new MyView();

// remove only the main region
myView.removeRegion('main');
var mainRegion = myView.removeRegion('main');

mainRegion.isDestroyed(); // -> true

// remove all regions
myView.removeRegions();
Expand Down

0 comments on commit b0a7e92

Please sign in to comment.