mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Convert input to select box
This commit is contained in:
@@ -65,13 +65,13 @@ habitrpg.controller('SettingsCtrl',
|
|||||||
$scope.dayStart = User.user.preferences.dayStart;
|
$scope.dayStart = User.user.preferences.dayStart;
|
||||||
|
|
||||||
$scope.openDayStartModal = function(dayStart) {
|
$scope.openDayStartModal = function(dayStart) {
|
||||||
var flooredDayStart = Math.floor(dayStart);
|
$scope.dayStart = +dayStart;
|
||||||
|
var flooredDayStart = Math.floor($scope.dayStart);
|
||||||
|
|
||||||
if (dayStart !== flooredDayStart || dayStart < 0 || dayStart > 24 ) {
|
if ($scope.dayStart !== flooredDayStart || $scope.dayStart < 0 || $scope.dayStart > 24 ) {
|
||||||
return alert(window.env.t('enterNumber'));
|
return alert(window.env.t('enterNumber'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.dayStart = dayStart;
|
|
||||||
$scope.nextCron = _calculateNextCron();
|
$scope.nextCron = _calculateNextCron();
|
||||||
|
|
||||||
$rootScope.openModal('change-day-start', { scope: $scope });
|
$rootScope.openModal('change-day-start', { scope: $scope });
|
||||||
|
|||||||
@@ -91,11 +91,15 @@ script(type='text/ng-template', id='partials/options.settings.settings.html')
|
|||||||
a(ng-click='showCustomDayStartInfo = !showCustomDayStartInfo') {{!showCustomDayStartInfo ? env.t('showMoreMore') : env.t('showMoreLess')}}
|
a(ng-click='showCustomDayStartInfo = !showCustomDayStartInfo') {{!showCustomDayStartInfo ? env.t('showMoreMore') : env.t('showMoreLess')}}
|
||||||
h5(ng-if='showCustomDayStartInfo')!=env.t('customDayStartInfo4')
|
h5(ng-if='showCustomDayStartInfo')!=env.t('customDayStartInfo4')
|
||||||
.form-horizontal
|
.form-horizontal
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
.col-sm-7
|
.col-sm-7
|
||||||
.input-group
|
select.form-control(ng-model='dayStart')
|
||||||
input.form-control(type='number', min='0', max='23', ng-model='dayStart')
|
- var number = 0
|
||||||
.input-group-addon= ':00 (' + env.t('24HrClock') + ')'
|
while number < 24
|
||||||
|
- var hour = number++ % 12
|
||||||
|
- var meridian = number < 12 ? 'AM' : 'PM'
|
||||||
|
option(value=number) #{hour ? hour : 12}:00 #{meridian}
|
||||||
|
|
||||||
.col-sm-5
|
.col-sm-5
|
||||||
br.visible-xs
|
br.visible-xs
|
||||||
|
|||||||
Reference in New Issue
Block a user