Jump to content


Photo

Mobile PdfFrame On Tap Event Fire My Event - How ?

tap

  • Please log in to reply
4 replies to this topic

#1 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 346 posts
  • LocationMelbourne Australia

Posted 12 March 2018 - 05:25 AM

TUnimPDFFrame UniEvents afterCreate
 
function afterCreate(sender)
{
  var me = sender;
  me.element.on('click', function()
    {
      me.fireEvent('_myClick'); // Never Fired
      alert('Clicked');                 // Never Executed
    }
  )
}
 
Please advise how I can fire an event within an event - thanks in advance

  • 0

Andy


#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4968 posts

Posted 12 March 2018 - 05:31 AM

Hi,

 

You can try to use 'tap' instead of 'click':

...
me.element.on('tap', function()
...

  • 0

#3 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 346 posts
  • LocationMelbourne Australia

Posted 12 March 2018 - 07:45 AM

Thanks but it does not work.

 

Can you advise ?

 

(I want to catch a "tap" event in TUnimPDFFrame and force a "Page-Fit", so after the user has changed the size many different ways I want a quick way to resize view back to page-fit [remembering the viewer has hidden the page-fit dropdown due to screen size]).


  • 0

Andy


#4 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4968 posts

Posted 12 March 2018 - 10:43 AM

(I want to catch a "tap" event in TUnimPDFFrame and force a "Page-Fit", so after the user has changed the size many different ways I want a quick way to resize view back to page-fit [remembering the viewer has hidden the page-fit dropdown due to screen size]).

 

Sorry, can you clarify what you wanted ?


  • 0

#5 andyhill

andyhill

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 346 posts
  • LocationMelbourne Australia

Posted 13 March 2018 - 12:23 AM

TUnimPDFFrame displays document. On mobile (iPhone) the Sizing DropDownBox is hidden (due to screen size).

 

User now zooms in and out of document but cannot return to Page-Fit mode.

 

I want to ADD a (tap actually a doubletap) event to TUnimPDFFrame so I can catch it via an AjaxEvent and then instruct the TUnimPDFFrame viewer to show the document in Page-Fit mode.

 

me.fireEvent('_MyDoubleTap'); // (changed event name from above) Never Fires

 

I need to catch this event and then force the viewer into Page-Fit mode.

 

I need help with both the event and the code to force Page-Fit.


  • 0

Andy






Also tagged with one or more of these keywords: tap

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users