Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to hide a web-item modal using javascript?

Sanjeev Pande August 5, 2014

I have a modal opened from web-item target options. How to hide that modal using javascript ?

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Christopher Whittington
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2014

If it's a dialog:

AP.require(['dialog'], function(dialog){
    dialog.close();
});

See: https://developer.atlassian.com/static/connect/docs/javascript/module-Dialog.html

Sanjeev Pande August 6, 2014

dialog.close will destroy the dialog.

Instead of closing it and destroying the dialog I want it to provide visibility hidden.

The idea is opening a dialog over a dialog hiding the previous one.

Adrian Moerchen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2014

You may alter your question to "hide" instead of "close".

1 vote
Adrian Moerchen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2014

You may just use CSS to hide it "display:none"

seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2014

CSS cannot be used to hide native elements with Atlassian Connect

Adrian Moerchen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2014

Sorry, mist the connect thingy.

But, are you sure about this? I've seen someone doing it, but can't remember how (although he noted it is probably a bug in connect).

Also the dialog is just an object, maybe it is possible to use it and set the CSS via jQuery: dialog.css('display', 'none'):

seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2014

Nope, also not possible to use javascript here :)

If there is a bug please point me to it so we can fix it!

Adrian Moerchen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2014

I will ask my teammate, when he's back from holiday. Maybe he already reported it.

Sanjeev Pande August 6, 2014

we cannot do dialog.css

Sanjeev Pande August 6, 2014

One more thing...

The dialog opened from the web-item has a submit button and a cancel link in it.
I don't want the submit button to be present in the dialog.

How to do that?

The api provided by connect i.e.

AP.require('dialog', function(dialog){

var submitButton = dialog.getButton("submit");

submitButton.disable();

});

has methods only to enable/disable it.

Patrick Streule
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 2014

Sanjeev,

You raised this question in a separate thread here, in the Google group and you created a bug on ecosystem.atlassian.comfor the same thing. Please post your questions in one location. This makes it easier for us and others to follow the conversation and to find the answer in the future.

Thanks,
Patrick

0 votes
Christopher Whittington
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2014

If you want to customise the dialog. You should remove the atlassian header / footer by setting chrome to false in webitem target options.

https://developer.atlassian.com/static/connect/docs/modules/fragment/web-item-target.html

Then you can customise the dialog as you wish.

0 votes
Sanjeev Pande August 6, 2014

One more thing...

The dialog opened from the web-item has a submit button and a cancel link in it.
I don't want the submit button to be present in the dialog.

How to do that?

The api provided by connect i.e.

AP.require('dialog', function(dialog){

var submitButton = dialog.getButton("submit");

submitButton.disable();

});

has methods only to enable/disable it.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events