Navigation

    Monaca & Onsen UI
    • Register
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. Conan_g
    C
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    Conan_g

    @Conan_g

    0
    Reputation
    7
    Posts
    566
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Conan_g Follow

    Posts made by Conan_g

    • RE: how to cancel the 'ons-back-button' action?

      I did come across the note in the api that it can be cancelled with an onclick event handler so it’s a moot point I suppose.

      posted in Onsen UI
      C
      Conan_g
    • RE: how to cancel the 'ons-back-button' action?

      Can someone confirm if this approach should still work. I’ve tried the following but the console.log won’t show so I don’t think the prepop event still exists. For the record it works with a click handler so the object is querying properly.

      page.querySelector('ons-back-button').addEventListener('prepop', function(event){
        console.log('t1');
        event.cancel();
      });
      
      posted in Onsen UI
      C
      Conan_g
    • RE: ons-carousel always covers full screen

      It works in codepen but here’s the link: https://codepen.io/conan_g/pen/WNQYKrb

      In the cap you should see that it is the exact same code. I’ve scrolled just a bit in the emulator so you can see that it’s the viewport height before you see the text below. I’ve also tried in Chrome using the inspector and got the same results.

      The onsen links are the from the library which I just grabbed last week and I’ve not altered anything there. I also tried with the CDN and got the same results.

      alt text

      posted in Onsen UI
      C
      Conan_g
    • RE: ons-carousel always covers full screen

      @conan_g Just an update for the second point, I did find a workable solution so long as I know my image sizes which I can do for now. I’d still like to know why removing fullscreen is not working though.

      So for say a 500x300 image the following works:

      ons-carousel {
          height: calc(300 * (100vw / 500));
      }
      
      posted in Onsen UI
      C
      Conan_g
    • ons-carousel always covers full screen

      Based on the API documentation and example I made a carousel without the the fullscreen attribute. Using Playground tool it works as expected. If I copy the exact same code from the sandbox to my local example the carousel height is the viewport height.

      The only workaround is to set the height absolutely for the ons-carousel element in css but obviously that’s not helpful because the height needed will be relative to the size of the image which will be determined by the viewport width.

      I guess I have two questions:

      • First: is this a known issue or am I missing something? It works the way I’d like using the Playground so I don’t get why my local version is different other than there’s possibly some difference in the libraries (for the record I’ve both downloaded the newest version using npm and also tried using the CDN).

      • Second: if this is a known issue, does anyone have a relatively straight forward solution using css, I would think using calc()? I reckon I could do it with js if need be but I’d just as soon not go down that rabbit hole if I can help it.

      posted in Onsen UI
      C
      Conan_g
    • RE: Newbie Getting Started Question

      Thanks, I wasn’t sure if there was an easier way but this makes sense.

      I can play with a bundler for a more elegant solution later but per the example I just made a /lib folder and dropped everything in there.

      posted in Onsen UI
      C
      Conan_g
    • Newbie Getting Started Question

      I’m new to both Cordova and OnSen so forgive my ignorance.

      Two add OnSen to a Cordova project the getting started quide cites two approaches:

      • You can add the css/js files via a CDN. I can do this and it works, assuming I remove the default Content-Security-Policy but I’d rather not do this.

      • The second approach cited is to install using node. I’ve done this and I can see the folder in my node_modules folder but the guide just stops there and doesn’t give any suggestions on how to include in your project.

      I do have an Angular background and for an Angular project I would just import the resources but what about a simple HTML/CSS application?

      • Is there a better way to add them to my project other that to just copy/paste into my local js/css folders?

      • Being new to Cordova as well, is it a bad idea to just relatively reference the node_modules folder? Ie will they get built properly?

      posted in Onsen UI
      C
      Conan_g