refactor(bs3): port drops modals

This commit is contained in:
Matteo Pagliazzi 2014-02-01 19:39:05 +01:00
parent f6a8b9e4cb
commit 8b29eb530a
2 changed files with 5 additions and 15 deletions

View file

@ -5,7 +5,7 @@
*/
angular.module('guideServices', []).
factory('Guide', ['$rootScope', 'User', '$timeout', function($rootScope, User, $timeout) {
factory('Guide', ['$rootScope', 'User', '$timeout', '$modal', function($rootScope, User, $timeout, $modal) {
/**
* Init and show the welcome tour. Note we do it listening to a $rootScope broadcasted 'userLoaded' message,
@ -130,7 +130,9 @@ angular.module('guideServices', []).
if (!eggs) {
eggs['Wolf'] = 1; // This is also set on the server
}
$rootScope.modals.dropsEnabled = true;
$modal.open({
templateUrl: 'modals/dropsEnabled.html'
});
});
$rootScope.$watch('user.items.pets', function(after, before) {

View file

@ -1,4 +1,3 @@
//div(modal='modals.dropsEnabled')
script(type='text/ng-template', id='modals/dropsEnabled.html')
.modal-header
h3=env.t('dropsEnabled')
@ -11,15 +10,4 @@ script(type='text/ng-template', id='modals/dropsEnabled.html')
span.item-drop-icon(class='Pet_Currency_Gem')
span!=env.t('useGems')
.modal-footer
button.btn.btn-default.cancel(ng-click='modals.dropsEnabled = false')=env.t('close')
//div(modal='modals.drop')
script(type='text/ng-template', id='modals/drop.html')
.modal-header
h3=env.t('itemDrop')
.modal-body
p
span.item-drop-icon(class='Pet_{{user._tmp.drop.type}}_{{user._tmp.drop.key}}')
| {{user._tmp.drop.dialog}}
.modal-footer
button.btn.btn-default.cancel(ng-click='modals.drop = false')=env.t('close')
button.btn.btn-default.cancel(ng-click='$close()')=env.t('close')