Преглед изворни кода

Update button shake for registering

pull/11/head
Jack Foltz пре 6 година
родитељ
комит
d3de95c5dc
Signed by: foltik <jack@foltz.io> GPG Key ID: 303F88F996E95541
4 измењених фајлова са 9 додато и 4 уклоњено
  1. +1
    -1
      app/public/shimapan/components/LoginComp.js
  2. +6
    -1
      app/public/shimapan/components/RegisterComp.js
  3. +1
    -1
      public/views/shimapan/login-form.html
  4. +1
    -1
      public/views/shimapan/register-form.html

+ 1
- 1
app/public/shimapan/components/LoginComp.js Прегледај датотеку

@@ -11,7 +11,7 @@ angular.module('LoginComp', ['AuthSvc']).component('loginComponent', {
$scope.error = true;
$timeout(function() {
$scope.error = false;
},820);
}, 820);
});
};
}]

+ 6
- 1
app/public/shimapan/components/RegisterComp.js Прегледај датотеку

@@ -2,12 +2,17 @@ var angular = require('angular');

angular.module('RegisterComp', ['AuthSvc']).component('registerComponent', {
templateUrl: '/views/shimapan/register-form.html',
controller: ['$scope', 'AuthService', function ($scope, AuthService) {
controller: ['$scope', '$timeout', 'AuthService', function ($scope, $timeout, AuthService) {
$scope.register = function () {
AuthService.register({
username: $scope.username,
password: $scope.password,
invite: $scope.invite
}).catch(function() {
$scope.error = true;
$timeout(function() {
$scope.error = false
}, 820);
});
};
}]

+ 1
- 1
public/views/shimapan/login-form.html Прегледај датотеку

@@ -4,7 +4,7 @@
<form ng-submit="login()">
<input id="username" placeholder="Username" class="form-control" type="text" ng-model="username"/>
<input id="password" placeholder="Password" class="form-control" type="password" ng-model="password"/>
<button type="submit" class="btn" ng-class="{shake: error, noshake: !error}">Submit</button>
<button type="submit" class="btn" ng-class="{shake: error}">Submit</button>
</form>
</fieldset>
</div>

+ 1
- 1
public/views/shimapan/register-form.html Прегледај датотеку

@@ -5,7 +5,7 @@
<input id="username" placeholder="Username" class="form-control" type="text" ng-model="username"/>
<input id="password" placeholder="Password" class="form-control" type="password" ng-model="password"/>
<input id="invite" placeholder="Invite Code" class="form-control" type="text" ng-model="invite"/>
<button type="submit" class="btn">Submit</button>
<button type="submit" class="btn" ng-class="{shake: error}">Submit</button>
</form>
</fieldset>
</div>

Loading…
Откажи
Сачувај