Menu icon Foundation

My Posts





My Comments

Kieran Mahon commented on Kieran Mahon's post about 4 years

Thanks again Christian,

i will incorporate the new code on the next build and let you know the results

Kieran Mahon commented on Kieran Mahon's post about 4 years

Just brought that through PhoneGap Build and tested it on my iPhone and iPad and all is working as expected.

And I got the scrolling working with CSS.

There is a slight flash where you can see the start page before the modal loads in.
Is this avoidable i.e., you dont see any of the start page until the modal is dismissed?

This is not a deal breaker at all so don’t worry about it if it is hassle Christian..

Thanks again.

Kieran Mahon commented on Kieran Mahon's post about 4 years

bingo :-)

I added the bower components,
and then added a ")" to the line I was getting the error on:

if (!store.get('termsaccepted')) {

this was based on the error I received in the Terminal when trying to build the app..

and then it all worked out ok..

Still need to fix the scrolling issue, but that should be solve-able via css..

you are a star...

thanks again.

Kieran Mahon commented on Kieran Mahon's post about 4 years

Here is a copy of my full controller:

 StartController.$inject = ['$scope', '$stateParams', '$state', '$controller', 'FoundationApi','store','ModalService'];
function StartController($scope, $stateParams, $state, $controller, fa,store,ModalService) {
angular.extend(this, $controller('DefaultController', {$scope: $scope, $stateParams: $stateParams, $state: $state}));

  if (!store.get('termsaccepted') {
           var modalOptions = {
            templateUrl: 'templates/modal.html',
            controller: 'ModalController'
          };

          ModalService.showModal(modalOptions).then(function(modal) {

            modal.close.then(function(result) {

              if (result) {
                store.set('termsaccepted',true);
              } 
            });
          });

  }
  }

Kieran Mahon commented on Kieran Mahon's post about 4 years

Ok, one thing,
I am getting a syntax error for this line in app.js which is causing the build to fail:

if (!store.get('termsaccepted') {

Kieran Mahon commented on Kieran Mahon's post about 4 years

Wow, I will try that now and let you know how I get on.

Thanks so much for taking the time to do that.

Just one thing,
I have another standard modal on that page,
which works from a button click etc.
Will this method affect that, i.e., does it affect all modals?

thanks again,

Kieran.

Kieran Mahon commented on Kieran Mahon's post about 4 years

My earlier comment of Scrolling being fixed was premature. It was working ok on localhost with the .modal set to overflow: scroll but when I tested the app on my devices it would not work.

Kieran Mahon commented on Kieran Mahon's post about 4 years

Hi Christian,

yes, I just need the Terms Modal to appear once, and when it is dismissed, then it should not appear again.

So I need them to only accept once,
but my issue is I have no idea how to program the js for that!

Kieran Mahon commented on Kieran Mahon's post about 4 years

Either way, the major issues I now have with the modal are:

  • the Modal content does not scroll (thought I fixed this with overflow:scroll) but obviously not so i cannot actually scroll to the end of the content

and

  • it looks like the Modal will show now every time that page is loaded, whereas I want the modal to only appear until the user presses the close button, in which case it will not appear again when they open or re-launch the app

Any help with these queries would be great

Kieran Mahon commented on Kieran Mahon's post about 4 years

Thanks for your reply,
I have tried Jeanie’s code which works but loads the Modal just after the rest of the page, which is ok, but by using the following version, i was able to see only the modal, no appearance of the page below it

  angular.module('application')
.controller('StartController', StartController)
;
StartController.$inject = ['$scope', '$stateParams', '$state', '$controller', 'FoundationApi'];
function StartController($scope, $stateParams, $state, $controller, fa) {
angular.extend(this, $controller('DefaultController', {$scope: $scope, $stateParams: $stateParams, $state: $state}));
  // your code...
  fa.publish('tcModal', 'open');
}

Posts Followed



Following

    No Content

Followers

My Posts

My Comments

You commented on Kieran Mahon's post about 4 years

Thanks again Christian,

i will incorporate the new code on the next build and let you know the results

You commented on Kieran Mahon's post about 4 years

Just brought that through PhoneGap Build and tested it on my iPhone and iPad and all is working as expected.

And I got the scrolling working with CSS.

There is a slight flash where you can see the start page before the modal loads in.
Is this avoidable i.e., you dont see any of the start page until the modal is dismissed?

This is not a deal breaker at all so don’t worry about it if it is hassle Christian..

Thanks again.

You commented on Kieran Mahon's post about 4 years

bingo :-)

I added the bower components,
and then added a ")" to the line I was getting the error on:

if (!store.get('termsaccepted')) {

this was based on the error I received in the Terminal when trying to build the app..

and then it all worked out ok..

Still need to fix the scrolling issue, but that should be solve-able via css..

you are a star...

thanks again.

You commented on Kieran Mahon's post about 4 years

Here is a copy of my full controller:

 StartController.$inject = ['$scope', '$stateParams', '$state', '$controller', 'FoundationApi','store','ModalService'];
function StartController($scope, $stateParams, $state, $controller, fa,store,ModalService) {
angular.extend(this, $controller('DefaultController', {$scope: $scope, $stateParams: $stateParams, $state: $state}));

  if (!store.get('termsaccepted') {
           var modalOptions = {
            templateUrl: 'templates/modal.html',
            controller: 'ModalController'
          };

          ModalService.showModal(modalOptions).then(function(modal) {

            modal.close.then(function(result) {

              if (result) {
                store.set('termsaccepted',true);
              } 
            });
          });

  }
  }

You commented on Kieran Mahon's post about 4 years

Ok, one thing,
I am getting a syntax error for this line in app.js which is causing the build to fail:

if (!store.get('termsaccepted') {

You commented on Kieran Mahon's post about 4 years

Wow, I will try that now and let you know how I get on.

Thanks so much for taking the time to do that.

Just one thing,
I have another standard modal on that page,
which works from a button click etc.
Will this method affect that, i.e., does it affect all modals?

thanks again,

Kieran.

You commented on Kieran Mahon's post about 4 years

My earlier comment of Scrolling being fixed was premature. It was working ok on localhost with the .modal set to overflow: scroll but when I tested the app on my devices it would not work.

You commented on Kieran Mahon's post about 4 years

Hi Christian,

yes, I just need the Terms Modal to appear once, and when it is dismissed, then it should not appear again.

So I need them to only accept once,
but my issue is I have no idea how to program the js for that!

You commented on Kieran Mahon's post about 4 years

Either way, the major issues I now have with the modal are:

  • the Modal content does not scroll (thought I fixed this with overflow:scroll) but obviously not so i cannot actually scroll to the end of the content

and

  • it looks like the Modal will show now every time that page is loaded, whereas I want the modal to only appear until the user presses the close button, in which case it will not appear again when they open or re-launch the app

Any help with these queries would be great

You commented on Kieran Mahon's post about 4 years

Thanks for your reply,
I have tried Jeanie’s code which works but loads the Modal just after the rest of the page, which is ok, but by using the following version, i was able to see only the modal, no appearance of the page below it

  angular.module('application')
.controller('StartController', StartController)
;
StartController.$inject = ['$scope', '$stateParams', '$state', '$controller', 'FoundationApi'];
function StartController($scope, $stateParams, $state, $controller, fa) {
angular.extend(this, $controller('DefaultController', {$scope: $scope, $stateParams: $stateParams, $state: $state}));
  // your code...
  fa.publish('tcModal', 'open');
}

Posts Followed



Following

  • No Content

Followers

  • No Content