Locomotive-scroll doesn't render page, when scrolling up [duplicate] - vue.js

I'm using locomotive scroll and nuxt3. This is my repo: https://github.com/cyprianwaclaw/nuxt.git
I imported async locomotive-scroll in layouts/scroll and added this layout in main app, but the scrolling is not smooth.
My styleccs are in the assets/css/tailwindcss file.
How can I make the scrolling smooth in my project?
And in my console I have this error:
locomotive-scroll.esm.526a65ed.mjs:7
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'offsetHeight')
at n.value (locomotive-scroll.esm.526a65ed.mjs:7:11013)
at n.value (locomotive-scroll.esm.526a65ed.mjs:7:10771)
at s.value (locomotive-scroll.esm.526a65ed.mjs:7:29026)
at new s (locomotive-scroll.esm.526a65ed.mjs:7:28450)
at scroll.70d56592.mjs:1:397

try add css style in nuxt.confi.ts :
css: [
'~/assets/css/tailwind.css',
'locomotive-scroll/dist/locomotive-scroll.css',
],

Related

Titanium evalJS slows loading of the webview - timeout waiting to evaluate js

I am developing Titanium application with a webview that is loading content from a remote url. In the load event I am injecting some code with evalJS. Using Titanium SDK 8.0.0+ the loading of the webview content is very slow because of evalJS, I need to wait for some time in order to scroll or click something. I can see in the console that there is a warning repeatedly saying "TiWebViewBinding: (main) [4405,4881] Timeout waiting to evaluate JS", and when this warning stops showing I can interact with the webview. If evalJS is not used meaning I am not injecting code, there is no problem. The webview is loaded properly and there is no warning saying "Timeout waiting to evaluate JS". Before 8.0.0 sdk the problem did not existed. Has anyone had an experience with an issue like this? Am I missing something?
I would be very grateful if I get some input on this. Thanks.
var webview = Ti.UI.createWebView({
width : Ti.UI.FILL,
height : Ti.UI.FILL,
url : "remote url"
});
webview.addEventListener('load', function() {
webview.evalJS('(function() {alert("test");})();');
webview.evalJS('(function sum(val1, val2){return val1 + val2;})();');
});
window.add(webview);
window.open();

yadcf error: Cannot read property 'oFeatures' of null at addRangeDateFilter

I'm running into the following issue:
jquery.dataTables.yadcf.js:1834 Uncaught TypeError: Cannot read property 'oFeatures' of null
at addRangeDateFilter (jquery.dataTables.yadcf.js:1834)
at appendFilters (jquery.dataTables.yadcf.js:3033)
at HTMLTableElement.<anonymous> (jquery.dataTables.yadcf.js:3768)
at HTMLDocument.dispatch (jquery.js:4435)
at HTMLDocument.r.handle (jquery.js:4121)
at Object.trigger (jquery.js:4350)
at HTMLTableElement.<anonymous> (jquery.js:4901)
at Function.each (jquery.js:374)
at n.fn.init.each (jquery.js:139)
at n.fn.init.trigger (jquery.js:4900)
This only occurs when I navigate to some other page and then come back to the old page. I am alo using range date filter on other pages with single datatables but this error doesn't come up. However on this page there are multiple datatables, so that might be a possible cause.
I'm using the following code:
yadcf.init(table, [
{
column_number: 5,
filter_container_id: 'dateFilter',
filter_type: 'range_date'
}],
{externally_triggered: true});
On loading the page initially there is no error but once I navigate back to this page after visiting some other page, this error comes up.
Is there any method to get around this?
I had an old version of jquery running, updated the library and this got fixed.

Sencha Touch [APPNAME].app is undefined only when testing with Jasmine

I'm trying to set up some test cases for a view using the Jasmine 2.3.4 assertion library for my Sencha Touch 2.4 app. Things seem great (I see the view rendered to a div) except the browser does not know what MyApp.app is. I have this line at my onContainerInitialize function from my view/container code:
var controller = MyApp.app.getController('loginController');
which gives this Jasmine error:
TypeError: Cannot read property 'getController' of undefined
At the time the Jasmine tests are called, from my console I do have a MyApp global object with the following structure (attached). If you expand app you will see the class name of the controller listed in an array under _controllers. The line that causes this error in my spec file is:
var myView = new MyApp.view.someViewName({ renderTo: 'test' });
I modeled my setup after a few tutorials, one of which is Sencha's https://docs.sencha.com/extjs/4.2.5/#!/guide/testing
(wish there was one for a recent version of Touch). I think my problem may be related to this note midway down that page:
Note: this Application definition is not a copy and paste of your
regular Application definition in your app.js. This version will only
include the controllers, stores, models, etc and when launch is called
it will invoke the Jasmine tests.
It may be related, but I also couldn't follow their:
ctrl = newMyApp.controller.MyController();
where I would get this error:
TypeError: app.getRouter is not a function at Ext.define.applyRoutes (http://localhost:8080/touch/sencha-t...ug.js:45800:26)
Instead, I had to add in this argument like this:
var ctrl = new Kaacoo.controller.loginController({ application : app });
Additionally, my launch file is set up like this:
Ext.require('Ext.app.Application');
Ext.Loader.setConfig({
enabled: true,
disableCaching: true
});
Ext.Loader.setPath('MyApp', '../../app');
// this file is a couple levels deep from the root of my project
Ext.application({
name : 'MyApp',
extend: 'MyApp.Application',
autoCreateViewport: true,
controllers: [
'loginController'
],
requires : [
],
launch: function() {
// Jasmine is bootstrapped with boot.js referenced in the html runner, so nothing here. My test specs are being called after this launch function is executed.
}
});
The order I have listed my resources in my html runner are: Jasmine Library with boot.js> Touch All Debug Library > Project Source Files > Spec Files > Launch file
Building and simulating the app is fine, so why can't I also have access to MyApp.app.getController('loginController') as well in my test environment?
Thanks!

Titanium : How to load an external custom AlertDialog in Alloy?

I code all my project in Alloy, so no classic Titanium here.
I want to load an external custom AlertDialog (located in views/popup.xml) in my index. So my need is to show an alert and destroy it (for ie.) by clicking the OK button. The Help button should do another action.
My popup.xml file :
<Alloy>
<AlertDialog id="popup" title="Error popup"
message="There is an error" cancel="1">
<ButtonNames>
<ButtonName>OK</ButtonName>
<ButtonName>Help</ButtonName>
</ButtonNames>
</AlertDialog>
</Alloy>
My index.js file :
function openPopup(e) {
var page = Alloy.createController('views/popup').getView();
page.show();
};
openPopup();
But this gives me an error :
[DEBUG] [iphone, 8.1, 192.168.0.1] Native
module:alloy/controllers/views/popup
[ERROR] [iphone, 8.1, 192.168.0.1] Couldn't find module:
alloy/controllers/views/popup
[ERROR] [iphone, 8.1, 192.168.0.1] TypeError: 'undefined' is not a
constructor (evaluating 'new (__p.require("alloy/controllers/" +
name))(args)')
I have no popup.js and I didn't require any file in index.js too. So my questions are : How to load a controller dynamically? How to remove (or destroy) it with an addEventListener on "click" action? Thank you.
Agree with turtle. When you create a controller it implicitly knows you are referring to a view in the the app/views directory.
And you should improve your code slightly by not creating a local variable (for garbage collection purposes). So instead of:
var page = Alloy.createController('views/popup').getView();
page.show();
You should just do:
Alloy.createController('views/popup').getView().open();
You can find more info about this in a splendid article by Fokke Zandbergen.
/John

ST2.1 - Uncaught TypeError: Object [object Object] has no method 'link'

I've just tried to upgrade my ST2.0 source files of my application to ST2.1 by copying over all the javascript files in my project in the 'src' folder. When I load the first screen I get the following error:
Uncaught TypeError: Object [object Object] has no method 'link'
Is there a standard way to upgrade to 2.1? Any ideas why am I getting this error?
It seems to be happening in container.js, at this point in code:
updateUseBodyElement: function(useBodyElement) {
if (useBodyElement) {
this.link('bodyElement', this.innerElement.wrap({
Uncaught TypeError: Object [object Object] has no method 'link'
cls: 'x-body'
}));
}
},
The src folder for 2.1 is different, you cannot upgrade by just copying over the files.
This is the site I used to get my app upgraded.
http://senchatouchexp.blogspot.com/2012/12/sencha-touch-20x-upgrade-21.html