Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Event Listener for Laytheme Instance Updating

Event Listener for Laytheme Instance Updating

Scheduled Pinned Locked Moved General Discussion
9 Posts 3 Posters 238 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    uncuerilla
    wrote on last edited by
    #1

    Hi,

    is there a way to listen to the update Event (if the app-instance reloads but the browser/page doesn't) from outside the instance? I'm changing all links on the page via jQuery function. And i need to call the function for that if something on the App is changing (for example, if i click on a project).

    Is there a way to get this kind of information out of the app?

    BR
    Mario

    1 Reply Last reply
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @uncuerilla
      what exactly do you want to achieve?
      Can you post a link to your website?
      We will then have a look and inspect that!
      Many wishes!
      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • U Offline
        U Offline
        uncuerilla
        wrote on last edited by
        #3

        I set a id-attribute for every project-thumbnail on the category page (for example "p05"). Then I update the href of the link of the project thumb with the same string as parameter (?project=p05). Then the project-page is being shown. At the end of this page I've got a Link "Back to overview", the href of this link should be updated with the parameter of the browser's url (=> ?project=p05).

        When the site is opening the category page again a jQuery function should be called that is getting the parameter of the url, to know what Project was clicked before and then scroll to that project thumbnail. Actually it's working, but sometimes the site doesn't reload and just changes the url and the view of the app. That's why the function that puts parameters on the links isn't called. So I need a trigger for that function. Maybe something like "if the new app-route is fully loaded then call the jquery function XY".

        I hope I described it so, that you can understand my problem ;-)

        Here you can see the test-version of the website:
        http://kunden.ruftop-agentur.de/christophspranger/

        Thanks in advance!!

        1 Reply Last reply
        0
        • mariusjopenM Offline
          mariusjopenM Offline
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          Dear @uncuerilla
          did you disable the right click?
          Very difficult to debug if you cannot right click…
          Best!
          Marius

          www.mariusjopen.world

          U 2 Replies Last reply
          0
          • mariusjopenM mariusjopen

            Dear @uncuerilla
            did you disable the right click?
            Very difficult to debug if you cannot right click…
            Best!
            Marius

            U Offline
            U Offline
            uncuerilla
            wrote on last edited by
            #5

            @mariusjopen oh yeah, sorry! It's disabled now.

            1 Reply Last reply
            0
            • mariusjopenM mariusjopen

              Dear @uncuerilla
              did you disable the right click?
              Very difficult to debug if you cannot right click…
              Best!
              Marius

              U Offline
              U Offline
              uncuerilla
              wrote on last edited by
              #6

              @mariusjopen I think the problem is, that the jQuery Code runs before the Instance of Lay Theme is fully loaded. So, I just would need a event like "hey Laytheme is now fully loaded!", that my custom code can wait for. You know what I mean? Is there a event, function or something I get access from outside?

              1 Reply Last reply
              0
              • arminunruhA Offline
                arminunruhA Offline
                arminunruh
                Global Moderator
                wrote on last edited by
                #7

                Try

                window.laytheme.on("content_ready", function(){
                });
                

                So I guess

                window.laytheme.on("newpageshown", function(){
                });
                

                is triggered before the content is rlly there right?

                mmmh from looking at my code the content should be there when the event newpageshown is triggered

                Can you try:

                window.laytheme.on("newpageshown", function(){
                setTimeout(function(){
                //put your code here
                },0)
                });
                
                1 Reply Last reply
                0
                • U Offline
                  U Offline
                  uncuerilla
                  wrote on last edited by
                  #8

                  Hey Armin,

                  thank you very much and sorry for the delayed answer! Thats what I was looking for!

                  Br
                  Mario

                  1 Reply Last reply
                  0
                  • mariusjopenM Offline
                    mariusjopenM Offline
                    mariusjopen
                    Global Moderator
                    wrote on last edited by
                    #9

                    Dear @uncuerilla
                    Perfect! Glad to hear!
                    Many wishes!
                    Marius

                    www.mariusjopen.world

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    I also code custom websites or custom Lay features.
                    💿 Email me here: 💿
                    info@laytheme.com

                    Before you post:
                    1. When using a WordPress Cache plugin, disable it or clear your cache.
                    2. Update Lay Theme and all Lay Theme Addons
                    3. Disable all Plugins
                    4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                    This often solves issues you might run into

                    When you post:
                    1. Post a link to where the problem is
                    2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                    3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                    Online Users
                    Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                    laytheme.com
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Search