Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Commit

Permalink
Fix some things
Browse files Browse the repository at this point in the history
  • Loading branch information
litenull committed Jan 22, 2015
1 parent d1cee3f commit 918871f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions public/js/controllers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global moment */

'use strict';

var controllerModule = angular.module('uchiwa.controllers', []);
Expand Down Expand Up @@ -465,7 +467,8 @@ controllerModule.controller('StashModalCtrl', ['$scope', '$filter', '$modalInsta
'900': 900,
'3600': 3600,
'86400': 86400,
'none': -1
'none': -1,
'custom': 'custom'
};
$scope.stash.reason = '';
$scope.stash.expiration = 900;
Expand Down Expand Up @@ -500,7 +503,7 @@ controllerModule.controller('StashModalCtrl', ['$scope', '$filter', '$modalInsta

$scope.ok = function () {

if ($scope.stash.custom && !calculateToFrom()) {
if ($scope.stash.expiration === 'custom' && !calculateToFrom()) {
notification('error', 'Please enter both from and to values.');
return false;
}
Expand Down
12 changes: 6 additions & 6 deletions public/partials/stash-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ <h3 class="modal-title" ng-if="acknowledged != items.length">
<span>
<h5>Expiration</h5>
<div class="btn-group">
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="900" ng-click="stash.custom = false">15 minutes</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="3600" ng-click="stash.custom = false">1 hour</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="86400" ng-click="stash.custom = false">24 hours</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" ng-click="stash.custom = true" btn-radio="null">Custom</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="-1" ng-click="stash.custom = false">No expiration</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="900">15 minutes</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="3600">1 hour</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="86400">24 hours</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="'custom'">Custom</label>
<label class="btn btn-xs btn-default" ng-model="stash.expiration" btn-radio="-1">No expiration</label>
</div>

<div ng-show="stash.custom">
<div ng-show="stash.expiration === 'custom'">
<div style="float:left">
<h5>From</h5>
<input type="text" ng-model="stash.content.from" placeholder="yyyy/mm/dd hh:mm:ss"/>
Expand Down

0 comments on commit 918871f

Please sign in to comment.