refactor(bs3): misc fixes & port death modal

This commit is contained in:
Matteo Pagliazzi
2014-02-01 16:46:48 +01:00
parent 1fbdd6cebe
commit ff49695635
5 changed files with 20 additions and 16 deletions
-4
View File
@@ -44,9 +44,5 @@
},
"devDependencies": {
"angular-mocks": "~1.2.1"
},
"resolutions": {
"jquery": ">=1.6.4",
"bootstrap": "~3.1.0"
}
}
+3 -3
View File
@@ -134,16 +134,16 @@ div.tooltip-inner {
.modal
whitespace: normal
// notification-character used only by death modal's figure, move
.notification-character
float:left
float: left
padding: 15px
.notification-message
display: inline-block;
padding-right: 1em
line-height: 3
.notification-action
vertical-align: baseline
#reset-modal
z-index:1500
#notification-area
+9 -1
View File
@@ -1,9 +1,17 @@
'use strict';
habitrpg.controller('NotificationCtrl',
['$scope', '$rootScope', 'Shared', 'User', 'Guide', 'Notification', function ($scope, $rootScope, Shared, User, Guide, Notification) {
['$scope', '$rootScope', 'Shared', 'User', 'Guide', 'Notification', '$modal',
function ($scope, $rootScope, Shared, User, Guide, Notification, $modal) {
$rootScope.$watch('user.stats.hp', function(after, before) {
if (after <= 0){
$modal.open({
templateUrl: 'modals/death.html',
keyboard: false,
backdrop: 'static'
});
}
if (after == before) return;
if (User.user.stats.lvl == 0) return;
Notification.hp(after - before, 'hp');
+1 -1
View File
@@ -14,7 +14,7 @@
=env.t('options')
li
a.task-action-btn.tile.solid(href="http://habitrpg.wikia.com/wiki/FAQ", target='_blank')
span.glyphicon.glyphicon.-book
span.glyphicon.glyphicon-book
=env.t('FAQ')
li
a.task-action-btn.tile.solid(href="https://vimeo.com/57654086", target='_blank')
+7 -7
View File
@@ -1,15 +1,15 @@
//div(modal='user.stats.hp <= 0', options='{backdrop:true, keyboard:false, backdropClick:false}')
script(type='text/ng-template', id='modals/death.html')
.modal-body
.row-fluid
.span4
.row
.col-md-3
figure.notification-character
.GrimReaper
.span8
.col-md-9
h2=env.t('youDied')
.row-fluid
.span4
.row
.col-md-3
p
a.btn.btn-danger.btn-large.notification-action(ng-click='user.ops.revive({})')=env.t('continue')
.span8
a.btn.btn-danger.btn-large(ng-click='user.ops.revive({}); $close()')=env.t('continue')
.col-md-9
p=env.t('dieText')