How do i disable the application menu on one qml page? Currently, all qml pages have application menu, but I want to disable it in the login page. My application menu is inside the main.qml. Here's what I added to my main.qml:
Menu.definition: MenuDefinition {
settingsAction: SettingsActionItem {
imageSource: "asset:///images/navbar_icon_settings.png"
onTriggered: {
cppObj.onSettingsClicked();
}
}
My main.qml is the first page which is the login page, but I dont want the user to be able to swipe down and reveal the settings button
Look at bb::cascades::Application::setMenuEnabled(bool enabled). I think this is what you need for your use case.
Related
Good day,
How can I permanently remove the title Odoo and the favicon from navigation menu in Odoo 15.
I am looking for a solution in code, the usually way of activating the debug mode and replace the favicon doesn't work. It first loads the Odoo icon then the icon you have uploaded.
Is their a way to replace permanently both of them
For the icon:
You can go to Settings>General Settings>Manage Companies and change the Company favicon field.
But if you want a code solution you can:
Step 1: Override the web module with your own module.
Step 2: Add the icon to your module folder under static/src/img
Step 3: Change the x_icon value
For the title:
You will have to override the init function in the abstract_web_client.js and call set('title_part', {"zopenerp": "My New Title"});
example:
WebClient.include({
init: function(parent, action, options) {
this._super.apply(this, arguments);
this.set('title_part', {"zopenerp": 'My New Title'});
}
});
Im coding integration tests in a project with cypress. This is the flow in my projet:
You click at a buy button of a projeto;
When you click, open a new tab in checkout product
Only this, click at a button and open a new tab with the checkout screen. But as we know, cypress dont have suport for multiple tabs, so how can i handle it? What is the way to open this new url in the same tab?
Important to highlight that this button is not wrapped by any a tag, its just a button that when I click has a handleClick that open a new tab and do other stuff. Because of this, none of these https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/testing-dom__tab-handling-links/cypress/integration/tab_handling_anchor_links_spec.js solutions work for me.
I already tried this:
cy.stub(win, "open")
.callsFake((url, target) => {
//#ts-ignore
return win.open.wrappedMethod.call(win, url, "_self");
//#ts-ignore
})
.as("open");
});
but no success.
My app needs a login page from external url.
The login logic that I thought is :
Steps
Open external url when ionic is launched
Once user logged in, move back to internal app using deep link (ex : myapp://main)
I tested step 2 which is deep link. Works well.
So, I have to make step 1 now.
First, I tested with iframe.
And got Refused to display 'https:....' in a frame because it set 'X-Frame-Options' to 'deny'. error. Seems this needs a server-side configuration. But anyway we don't want to use this way. iframe feels like a hack.
Second, I tried location.href = this.loginUrl;.
Worked well in chrome browser but when I built in iOS simulator, I see address bar, tool bar, and close button.
I don't like this because I don't want user to close login page or to change url address.
Third, tried window.open(this.loginUrl, '_self', 'location=no').
Same result as second.
Fourth, tried to use ionic version of in-app-browserplugin.
But the result is same as second and third.
It still opens a browser with address bar, tool bar even it shows 'back to myApp'. So user would feel this is out of app.
Check here, people are looking for the solution still.
After spending a day, I don't even know if there is option I can try.
I could resolve by doing this. But in real device.
Xcode iPhone emulators don't have open in-app-browser but built-in browser.
browser:any;
this.platform.ready().then(() => {
this.browser = this.iab.create(this.loginUrl, '_blank', 'location=no,toolbar=no');
});
You can solve this by installing a cordova plugin called cordova-plugin-inappbrowser. Execute the following commands:
ionic plugin add cordova-plugin-inappbrowser
npm install --save #ionic-native/in-app-browser
On your app.module.ts add
import { InAppBrowser } from '#ionic-native/in-app-browser';
and also add the following to your providers in app.module.ts
providers: [
StatusBar,
SplashScreen,
InAppBrowser,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
Then on your home.ts add
import { InAppBrowser } from '#ionic-native/in-app-browser';
and inject it into the constructor like this
constructor(public navCtrl: NavController, private iab: InAppBrowser) {
}
then add the following method
ionViewDidLoad(){
this.iab.create('url', '_self', { location: 'no' }); }
Check the different options you have for this plugin here
For removing the address bar just use the option:
location: Set to yes or no to turn the InAppBrowser's location bar on or off.
I'm using Magnific popup our product product pages as a method for image hot points. Right now when you click on a hot point a popup appears with larger image and text. I received a request to open the popup on a mouseover.
Is there a way to trigger open Magnific Popup on a mouseover not on a mouse click?
I was trying to call the mouseover event on the link first, but it seems the Popup still requires a click. How to I make it so it opens up just with a mouseover?
<!-- Popup link -->
Show inline popup
<!-- Popup itself -->
<div id="test-popup" class="white-popup mfp-hide">
Popup content
</div>
Javascript:
$('.open-popup-link').mouseover(function(){
$(this).magnificPopup({
type: 'inline'
});
});
Answering my own question. After a bit more research I found that I needed to open the popup directly via API. It works now:
$('.open-popup-link').mouseover(function(){
$.magnificPopup.open({
items: {
src: '.white-popup' // can be a HTML string, jQuery object, or CSS selector
}
})
});
Working example: https://codepen.io/pen/ZKrVNK
Taking it further with multiple links opening separate slides of a gallery, using event delegation:
http://codepen.io/pen/EmEOMa
I have FB.ui working well, I can share whatever info I need to share. However the issue is that it's being rolled into a Web App (This "add to home screen") for an ipad. Whenever the dialog opens, it's opened full screen, and once it's shared there is no way to close the opened dialog.
<input type="button" onclick="share_prompt()" value="Share" />
function share_prompt()
{
FB.ui(
{
method: 'feed',
display: "iframe",
name: 'Facebook Dialogs',
link: 'http://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
message: 'Facebook Dialogs are easy!'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
}
I've changed the "display" property to everything possible, but the docs say that it defaults to a "touch" display in web apps.
Also, to make it even more frustrating, the response doesn't fire when in web app mode. Only in the browser window.
Any ideas?
This is the way I solved this:
if(navigator.standalone){
new_url = 'https://www.facebook.com/dialog/feed?'+
'app_id=XXXXXXXXXXXXX'+
'&display=popup'+
'&caption='+fbName+
'&picture='+fbPicture+
'&description='+fbDescription+
'&link='+fbLink+
'&redirect_uri=http://myurl.com/mycontroller/#post_id';
window.open(new_url,'_self');
} else {
//do the normal way
}
This way you can have a redirect url and you can send the post id back to your app if you need it. Hope this answers your question if you still didn't find a way to solve it.