Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fw.soleModal z-index override places it behind fw.OptionsModal #355

Closed
danyj opened this issue Mar 13, 2015 · 14 comments
Closed

fw.soleModal z-index override places it behind fw.OptionsModal #355

danyj opened this issue Mar 13, 2015 · 14 comments
Assignees

Comments

@danyj
Copy link
Contributor

danyj commented Mar 13, 2015

I have fw.OptionsModal open , if info i one of the inputs is incorrect I am calling
fw.soleModal to display the error, but it's z-index is lower than z-index from fw.OptionsModal so it ends-up being displayed behind the modal box. Seems like there is additional CSS override for it , see this ,

http://prntscr.com/6gakio

the fw.OptionsModal is media-modal-backdrop and has z-index of 160001
fw.soleModal original of 170001 would have worked fine but the override of 10000 kills it.

@ghost ghost assigned GheorgheP Mar 13, 2015
@danyj
Copy link
Contributor Author

danyj commented Mar 13, 2015

And I am not sure if this param should display soleModal ID

* fw.soleModal.show('unique-id', 'Hello World!');

but it does not in my case

fw.soleModal.show( 'thz_style_exists',modal_html,{
        autoHide: 5000,
        allowClose: true
    }
);

@ghost
Copy link

ghost commented Mar 13, 2015

but it does not

Look in page footer, if the modal is there, then the required styles are not enqueued, try to run on that page (php) wp_enqueue_media();.

@danyj
Copy link
Contributor Author

danyj commented Mar 13, 2015

all styles are there and the page is theme options , fw.css is loaded

https://github.com/ThemeFuse/Unyson/search?utf8=%E2%9C%93&q=fw-sole-modal

@ghost
Copy link

ghost commented Mar 13, 2015

wp_enqueue_media(); has styles for .media-modal

@danyj
Copy link
Contributor Author

danyj commented Mar 13, 2015

I tried

add_action( 'admin_enqueue_scripts', 'wp_enqueue_media' );

and

 wp_enqueue_media();

in hooks.php
and see no change. Are you talking about the ID being displayed or the CSS z-index bug?

@ghost
Copy link

ghost commented Mar 13, 2015

Are you talking about the ID being displayed or the CSS z-index bug?

About the ID being displayed. CSS z-index bug will be investigated later.

@danyj
Copy link
Contributor Author

danyj commented Mar 13, 2015

Ah ok , well that did not work http://prntscr.com/6gb7oj

@ghost
Copy link

ghost commented Mar 13, 2015

I executed the code below in my browser console and the modal was opened

fw.soleModal.show( 'thz_style_exists', 'Hello', {
        autoHide: 5000,
        allowClose: true
    }
);

@danyj
Copy link
Contributor Author

danyj commented Mar 13, 2015

about ID , I dont need it specifically now , just wanted to give you heads up.
Not even your saving solo modal has it and I see that you did place it

* fw.soleModal.show('unique-id', 'Hello World!');

Modal opens just fine, I thought that this

* fw.soleModal.show('unique-id', 'Hello World!');

should place an attribute ID here http://prntscr.com/6gb9hf

@danyj
Copy link
Contributor Author

danyj commented Mar 13, 2015

For Z-index bug test this in console

var modal = new fw.OptionsModal({
title: 'Custom Title',
options: [
   {'test1': {
       'type': 'text',
       'label': 'Test1'
   }},
   {'test2': {
       'type': 'textarea',
       'label': 'Test2'
   }}
],
values: {
   'test1': 'Default1',
   'test2': 'Default2'
}
});

modal.open();
fw.soleModal.show('unique-id', 'Hello World!');

@ghost
Copy link

ghost commented Mar 13, 2015

That id is used to prevent the same modal being open multiple times. For e.g. currently a modal is open (for 5 seconds), in that time, another script is calling fw.soleModal.show() multiple times, if there were no id, after the first modal will be closed, the same modal will be open again and again after you click close. Now when you call multiple times, the previous call is replaced, and every time in queue there is only one modal with that id.

Why do you need the id to be added in html?

@danyj
Copy link
Contributor Author

danyj commented Mar 13, 2015

yes I just tested and is used as handle not as attribute ID,
I see that no ID attribute is used here,

'<div class="fw-modal fw-sole-modal" style="display:none;">'+

I dont need it , just thought it does places and ID attribue, when I ran in to z-index bug I wanted to catch only my modal by ID an give it higher index , thus the question.

@danyj
Copy link
Contributor Author

danyj commented Mar 13, 2015

So that I can continue the work , I did this until bug is fixed

.fw-sole-modal .media-modal{
    z-index:500000;
}

@ghost
Copy link

ghost commented Mar 13, 2015

Yes, I think this is the solution, but I will see later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants