fixed StartPage glitch bug
This commit is contained in:
parent
e0897486f6
commit
a7ca0e3b15
|
@ -14,7 +14,7 @@
|
|||
"angular": "~1.3.20",
|
||||
"angular-resource": "~1.4.4",
|
||||
"angular-animate": "~1.3.20",
|
||||
"angular-mocks": "1.4.7",
|
||||
"angular-mocks": "~1.3.20",
|
||||
"angular-bootstrap": "~0.12.0",
|
||||
"angular-ui-utils": "~0.1.1",
|
||||
"angular-ui-router": "~0.2.11",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a href="/#!/" class="navbar-brand">
|
||||
Node<span>Forms</span>
|
||||
<i class="fa fa-archive" style="padding-right: 0.3em;"></i>Node<span>Forms</span>
|
||||
</a>
|
||||
</div>
|
||||
<nav class="collapse navbar-collapse" collapse="!isCollapsed" role="navigation">
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
<div class="image-background">
|
||||
</div>
|
||||
<div class="jumbotron text-center">
|
||||
<div class="row container" data-ng-if="!authentication.isAuthenticated()">
|
||||
<div class="container" data-ng-if="!authentication.isAuthenticated()">
|
||||
<div class="row text-center logo" style="border-bottom: 1px solid rgba(255,255,255,.2); margin-bottom: 30px;">
|
||||
<h3 class="col-xs-12" style="color: #FA787E; margin-bottom:0px">
|
||||
<i class="fa fa-archive fa-3x"></i>
|
||||
</h3>
|
||||
<h2 class="col-xs-12" style="margin-top:0px">
|
||||
Node<span style="color: #FA787E">Forms</span>
|
||||
<span style="color: #FA787E">Node<span style="text-decoration: underline;">Forms</span></span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="row" style="margin-top:0px">
|
||||
|
@ -32,8 +32,8 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12" style="margin-top:7%;">
|
||||
<a class="btn btn-info signup-btn" href="/#!/signup" style="background-color:#FA787E; border: none; font-size: 2em; padding: 0.3em 0.9em; color: white;">
|
||||
<div class="row" style="margin-top:7%;">
|
||||
<a class="col-xs-4 col-xs-offset-4 btn btn-info signup-btn" href="/#!/signup" style="background-color:#FA787E; border: none; font-size: 2em; padding: 0.3em 0.9em; color: white;">
|
||||
sign me up!
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -77,6 +77,12 @@ angular.module('forms').controller('AdminFormController', ['$rootScope', '$scope
|
|||
$scope.cancelDeleteModal = function(){
|
||||
if($scope.deleteModal){
|
||||
$scope.deleteModal.dismiss('cancel');
|
||||
$scope.deleteModal.result(function(selectedItem){
|
||||
this.selected = selectedItem;
|
||||
}, function(type){
|
||||
this.canceled = true;
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ angular.module('forms').directive('autoSaveForm', ['$rootScope', '$timeout', fun
|
|||
if(!err){
|
||||
console.log('\n\nForm data persisted -- setting pristine flag');
|
||||
$formCtrl.$setPristine();
|
||||
$formCtrl.$setUntouched();
|
||||
}else{
|
||||
console.error('Error form data NOT persisted');
|
||||
console.error(err);
|
||||
|
@ -63,11 +64,13 @@ angular.module('forms').directive('autoSaveForm', ['$rootScope', '$timeout', fun
|
|||
|
||||
//Update/Save Form if any Form fields are Dirty and Touched
|
||||
$scope.$watch(function(newValue, oldValue) {
|
||||
// console.log($scope);
|
||||
// console.log($scope.editForm);
|
||||
console.log('introParagraphStartPage.$dirty: '+$scope.editForm.introParagraphStartPage.$dirty);
|
||||
console.log('introParagraphStartPage.$touched: '+$scope.editForm.introParagraphStartPage.$touched);
|
||||
if($rootScope.finishedRender && $scope.anyDirtyAndTouched($scope.editForm) && !$rootScope.saveInProgress){
|
||||
// console.log('Form saving started');
|
||||
console.log('Form saving started');
|
||||
debounceSave();
|
||||
console.log('introParagraphStartPage.$dirty AFTER: '+$scope.editForm.introParagraphStartPage.$dirty);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
admin: 'ed873933b1f1dea0ce12fab9',
|
||||
language: 'english',
|
||||
form_fields: [
|
||||
{fieldType:'textfield', title:'First Name', fieldValue: '', deletePreserved: false},
|
||||
{fieldType:'checkbox', title:'nascar', fieldValue: '', deletePreserved: false},
|
||||
{fieldType:'checkbox', title:'hockey', fieldValue: '', deletePreserved: false}
|
||||
{fieldType:'textfield', title:'First Name', fieldValue: '', deletePreserved: false, _id:'56340745f59a6fc9e22028e9'},
|
||||
{fieldType:'checkbox', title:'nascar', fieldValue: '', deletePreserved: false, _id:'5c9e22028e907634f45f59a6'},
|
||||
{fieldType:'checkbox', title:'hockey', fieldValue: '', deletePreserved: false, _id:'56e90745f5934fc9e22028a6'}
|
||||
],
|
||||
_id: '525a8422f6d0f87f0e407a33'
|
||||
};
|
||||
|
@ -40,14 +40,14 @@
|
|||
admin: 'ed873933b1f1dea0ce12fab9',
|
||||
language: 'english',
|
||||
form_fields: [
|
||||
{fieldType:'textfield', title:'First Name', fieldValue: '', deletePreserved: false},
|
||||
{fieldType:'checkbox', title:'nascar', fieldValue: '', deletePreserved: false},
|
||||
{fieldType:'checkbox', title:'hockey', fieldValue: '', deletePreserved: false}
|
||||
{fieldType:'textfield', title:'First Name', fieldValue: '', deletePreserved: false, _id:'56340745f59a6fc9e22028e9'},
|
||||
{fieldType:'checkbox', title:'nascar', fieldValue: '', deletePreserved: false, _id:'5c9e22028e907634f45f59a6'},
|
||||
{fieldType:'checkbox', title:'hockey', fieldValue: '', deletePreserved: false, _id:'56e90745f5934fc9e22028a6'}
|
||||
],
|
||||
visible_form_fields: [
|
||||
{fieldType:'textfield', title:'First Name', fieldValue: '', deletePreserved: false},
|
||||
{fieldType:'checkbox', title:'nascar', fieldValue: '', deletePreserved: false},
|
||||
{fieldType:'checkbox', title:'hockey', fieldValue: '', deletePreserved: false}
|
||||
{fieldType:'textfield', title:'First Name', fieldValue: '', deletePreserved: false, _id:'56340745f59a6fc9e22028e9'},
|
||||
{fieldType:'checkbox', title:'nascar', fieldValue: '', deletePreserved: false, _id:'5c9e22028e907634f45f59a6'},
|
||||
{fieldType:'checkbox', title:'hockey', fieldValue: '', deletePreserved: false, _id:'56e90745f5934fc9e22028a6'}
|
||||
],
|
||||
_id: '525a8422f6d0f87f0e407a33'
|
||||
};
|
||||
|
@ -160,8 +160,8 @@
|
|||
});
|
||||
}));
|
||||
|
||||
beforeEach(inject(function($modal) {
|
||||
spyOn($modal, 'open').and.returnValue(new fakeModal());
|
||||
beforeEach(inject(function($uibModal) {
|
||||
spyOn($uibModal, 'open').and.returnValue(new fakeModal());
|
||||
}));
|
||||
|
||||
// The injector ignores leading and trailing underscores here (i.e. _$httpBackend_).
|
||||
|
@ -262,19 +262,13 @@
|
|||
expect( scope.deleteModal.opened ).toEqual(true);
|
||||
});
|
||||
|
||||
it('$scope.cancelDeleteModal() should close scope.deleteModal', inject(function($modal) {
|
||||
it('$scope.cancelDeleteModal() should close $scope.deleteModal', inject(function($uibModal) {
|
||||
var controller = createAdminFormController();
|
||||
|
||||
//Run controller functionality
|
||||
scope.openDeleteModal();
|
||||
console.log(scope.deleteModal.opened);
|
||||
|
||||
scope.deleteModal.result(function(selectedItem){
|
||||
this.selected = selectedItem;
|
||||
}, function(type){
|
||||
this.canceled = true;
|
||||
});
|
||||
|
||||
//Run controller functionality
|
||||
scope.cancelDeleteModal();
|
||||
expect( scope.deleteModal.opened ).toEqual(false);
|
||||
|
|
|
@ -99,8 +99,7 @@
|
|||
<div class="col-md-8 col-sm-12">
|
||||
<textarea type="text"
|
||||
ng-model="myform.startPage.introParagraph"
|
||||
name="introParagraphStartPage"
|
||||
value="{{myform.startPage.introParagraph}}"/>
|
||||
name="introParagraphStartPage"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -109,7 +108,7 @@
|
|||
<div class="row options buttons">
|
||||
<div class="col-md-3 col-xs-12">Buttons:</div>
|
||||
<div class="col-md-9 col-xs-12">
|
||||
<div ng-repeat="button in myform.startPage.buttons" class="row" style="padding-bottom:1em;">
|
||||
<div ng-repeat="button in myform.startPage.buttons track by button._id" class="row" style="padding-bottom:1em;">
|
||||
|
||||
<div class="col-xs-5">
|
||||
<span>Text</span>
|
||||
|
@ -215,7 +214,7 @@
|
|||
<div class="row options" ng-show="showAddOptions(field)">
|
||||
<div class="col-md-4 col-xs-12">Options:</div>
|
||||
<div class="col-md-8 col-xs-12">
|
||||
<div ng-repeat="option in field.fieldOptions" class="row">
|
||||
<div ng-repeat="option in field.fieldOptions track by option.option_id" class="row">
|
||||
<input type="text" name="{{option.option_value}}{{field._id}}" ng-model="option.option_value" class="col-xs-5">
|
||||
|
||||
<a class="btn btn-danger btn-mini right" type="button" ng-click="deleteOption(field, option)" class="col-xs-3">
|
||||
|
|
|
@ -55,44 +55,6 @@
|
|||
|
||||
beforeEach(module('stateMock'));
|
||||
|
||||
// Mock Users Service
|
||||
// beforeEach(module(function($provide) {
|
||||
// $provide.service('User', function($q) {
|
||||
// return {
|
||||
// getCurrent: function() {
|
||||
// var deferred = $q.defer();
|
||||
// deferred.resolve( JSON.stringify(sampleUser) );
|
||||
// return deferred.promise;
|
||||
// },
|
||||
// login: function(credentials) {
|
||||
// var deferred = $q.defer();
|
||||
// if( credentials.password === sampleUser.password && credentials.username === sampleUser.username){
|
||||
// deferred.resolve( JSON.stringify(sampleUser) );
|
||||
// }else {
|
||||
// deferred.resolve('Error: User could not be loggedin');
|
||||
// }
|
||||
|
||||
// return deferred.promise;
|
||||
// },
|
||||
// logout: function() {
|
||||
// var deferred = $q.defer();
|
||||
// deferred.resolve(null);
|
||||
// return deferred.promise;
|
||||
// },
|
||||
// signup: function(credentials) {
|
||||
// var deferred = $q.defer();
|
||||
// if( credentials.password === sampleUser.password && credentials.username === sampleUser.username){
|
||||
// deferred.resolve( JSON.stringify(sampleUser) );
|
||||
// }else {
|
||||
// deferred.resolve('Error: User could not be signed up');
|
||||
// }
|
||||
|
||||
// return deferred.promise;
|
||||
// }
|
||||
// };
|
||||
// });
|
||||
// }));
|
||||
|
||||
// The injector ignores leading and trailing underscores here (i.e. _$httpBackend_).
|
||||
// This allows us to inject a service but then attach it to a variable
|
||||
// with the same name as the service.
|
||||
|
|
Loading…
Reference in a new issue