Turning on fastclick


#1

I am using AppStudio 7.3.0, fastclick has been turned off by default. I see the file fastclick.js under folder [Program Files\NSB AppStudio\nsb\library]. How can I turn it on again in my project?

Thank you for the help.


#2

Solution: drag fastclick.js into project and add this into ExtraHeaders: window.addEventListener(‘load’, function() {new FastClick.attach(document.body)}, false);

Thanks


#3

Fastclick themselves say it should no longer be needed. What’s the use case?

Note: As of late 2015 most mobile browsers - notably Chrome and Safari - no longer have a 300ms touch delay, so fastclick offers no benefit on newer browsers, and risks introducing bugs into your application. Consider carefully whether you really need to use it.


#4

I’m trying this solution, but all it does is show the ExtraHeader text at the top of the screen when I build my app (Xcode using phonegap).

I’m using an older version of Phonegap to build, which I believe is still using older internal browser as there is still the 300ms delay when running the app, even on a newer iphone with ios 12.


#5

I am using iPhone Xs Max, latest iOS, AppStudio 7.3.0.1, jQuery Mobile with List menus, PhoneGap cli-6.5.0.

Without fastclick my list menu does not work. After turning fastclick on everything is working perfect.


#6

What version of jquery do you have behind JQM?


#7

I could believe this as a problem with jQuery Mobile - it hasn’t been updated in years. (That’s why we’re encouraging people to convert to Bootstrap: https://blog.nsbasic.com/2019/01/something-from-the-labs-framework-converter/)

We’ll put it back in the next build.


#8

There are some tricks to JQM and one of those tricks is in using the proper version of jquery.

By and large, JQM still works and you can get it to do most things BUT it’s age (especially design wise) really shows when you compare it to today’s UX standards.


#9

I am using: https://jqwidgets.com/public/jqwidgets


#10

AppStudio automatically uses the right version of jQuery. If your project uses jQuery Mobile, the latest version of jQuery that works is 2.2.0. For all other frameworks, the current version (3.3.1) is used. That’s one of the reasons jQuery Mobile cannot be used together with other frameworks.


#11

Thank you, understood!


#12

I found the most reliable version of jquery to use with jquery mobile is 2.1.4.

Either way, if 2.2.0 doesn’t solve the problem, try this;

  // manually enhance the panel because it resides outside the page <div>
  // and will appear as crap and hang the app 
  $( function() {
    $( "#homeMenu" ).enhanceWithin().panel();
    $( "#menuList" ).enhanceWithin().listview();
    $( "#homeMenu" ).trigger( "updatelayout" );
  } );

#13

AppStudio 7.3.0.2 loads fastclick automatically if you’re using jQM List. We put it back just for this control: in general, it should not be needed, but the jQM controls have not been updated in years by their authors.


#14

Thank you for the update!


#15

Hello George. The upgrade file (7.3.0.2) does not contain the update itself.


#16

You’re right. This issue needs more work - we’ll fix it.


#17

Just tried it again - it seems to be working properly for me in 7.3.0.2.

Run your app. Right click and View Source. Is there a line like this in the heading?

<script src="nsb/library/fastclick.js"></script>

#18

Thank you George, but the thing is that you have placed the wrong file to download. After I download it it does not update version.


#19

Please try again now.


#20

The new version 7.3.0.2 places this, and does not work:

if (NSB.fastclick !== true) {window.addEventListener(‘load’, function() {new FastClick.attach(document.body)}, false); NSB.fastclick=true;};

But, if I do it manually it works:

window.addEventListener(‘load’, function() {new FastClick.attach(document.body)}, false);

SR