Skip to content
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
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,23 @@ $ionicNativeTransitions.locationUrl('/yourUrl', {
});
```

### Next View Options

```
# * @description
# * Set options for next view
# * @param {object} transitionOptions

$ionicNativeTransitions.nextViewOptions({
"type": "slide",
"direction": "down", // 'left|right|up|down', default 'left' (which is like 'next')
"duration": 1500, // in milliseconds (ms), default 400
"fixedPixelsTop": 100, // the number of pixels of your fixed header, default 0 (iOS and Android)
"fixedPixelsBottom": 0, // the number of pixels of your fixed footer (f.i. a tab bar), default 0 (iOS and Android)
});
```
Use this method before $state.transitionTo or any method for page changing.

## Using directives

```
Expand Down
36 changes: 28 additions & 8 deletions dist/ionic-native-transitions.js

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

2 changes: 1 addition & 1 deletion dist/ionic-native-transitions.js.map

Large diffs are not rendered by default.

39 changes: 29 additions & 10 deletions lib/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,22 @@ export default function() {
function $get($log, $ionicConfig, $rootScope, $timeout, $state, $location, $ionicHistory, $ionicPlatform) {
'ngInject';

let legacyGoBack, backButtonUnregister;
let legacyGoBack, backButtonUnregister, nextViewOptionsObject;

return {
init,
getDefaultOptions,
enable: enableFromService,
isEnabled,
transition,
registerToRouteEvents,
unregisterToRouteEvents,
registerToStateChangeStartEvent,
unregisterToStateChangeStartEvent,
locationUrl,
stateGo,
goBack
isEnabled,
transition,
registerToRouteEvents,
unregisterToRouteEvents,
registerToStateChangeStartEvent,
unregisterToStateChangeStartEvent,
locationUrl,
stateGo,
goBack,
nextViewOptions
};


Expand Down Expand Up @@ -278,6 +279,10 @@ export default function() {
options = defaultTransition;
}
options = angular.copy(options);
if(nextViewOptionsObject){
options = angular.extend({}, options, nextViewOptionsObject);
nextViewOptionsObject = undefined;
}
let type = options.type;
delete options.type;
$log.debug('[native transition]', options);
Expand Down Expand Up @@ -502,5 +507,19 @@ export default function() {
$ionicHistory.goBack(backCount);
transition('back', currentStateTransition, toStateTransition);
}

/**
* @ngdoc function
* @name ionic-native-transitions.$ionicNativeTransitions#nextViewOptions
* @access public
* @methodOf ionic-native-transitions.$ionicNativeTransitions
*
* @description
* Set options for next view transition
* @param {object} options - transition options
*/
function nextViewOptions(options){
nextViewOptionsObject = options;
}
}
};