Problems with 2.18

JohnnyGlemoure's picture
JohnnyGlemoure
Wed, 07/08/2015 - 05:39
#1
Problems with 2.18

Hi,

i'm experiencing 2 problems with latest version:

  1. it seems that 2.18 is incompatible with jquery update module, if it's enabled i cannot use mdslider admin interface 

  2. the images are vertically resized according the window resolution, but in 2.17 doesn't happen

So at the moment i cannot use 2.18 version.

Can you help me?

phuonght's picture
phuonght
Wed, 07/08/2015 - 06:01

Hi,

Could you send us your site url, admin account and FTP account ( forum link as well) via email: [email protected]?

We would like to have a check.

JohnnyGlemoure's picture
JohnnyGlemoure
Wed, 07/08/2015 - 10:39

The main site has 2.17 version, i tested the 2.18 on a private network.

The main difference in the html code is the style inside the image tag

2.17: style="width:auto; height:420px; left:-40px; top: 0px;"

2.18: style="width:1840; height: auto; left: 0px; top:0px;

I solved the first problem setting in Jquery Update module: Alternate jQuery version for administrative pages -> Default (provided by Drupal)

phuonght's picture
phuonght
Wed, 07/08/2015 - 22:34

Thank you for your feedback.

It will help us and other customer a lot :)

JohnnyGlemoure's picture
JohnnyGlemoure
Thu, 07/09/2015 - 08:14

And now the second problem:

"the images are vertically resized according the window resolution, but in 2.17 doesn't happen"

File js/md-slider.js

the function is changeImagePosition

2.17

if (height > 0 && panelHeight > 0) {
                if (((width / height) > (panelWidth / panelHeight))) {
                    var left = panelWidth - (panelHeight / height) * width;
                    $background.css({
                        width: "auto",
                        height: panelHeight + "px"
                    });
                    if (left < 0) {
                        $background.css({left: (left / 2) + "px", top: 0});
                    } else {
                        $background.css({left: 0, top: 0});
                    }
                } else {
                    var top = panelHeight - (panelWidth / width) * height;
                    $background.css({width: panelWidth + "px", height: "auto"});
                    if (top < 0) {
                        $background.css({top: (top / 2) + "px", left: 0});
                    } else {
                        $background.css({left: 0, top: 0});
                    }
                }
            }

2.18

if (height > 0 && panelHeight > 0) {

                //if (((width / height) > (panelWidth / panelHeight))) {
                //    var left = panelWidth - (panelHeight / height) * width;
                //    $background.css({
                //        width: "auto",
                //        height: panelHeight + "px"
                //    });
                //    if (left < 0) {
                //        $background.css({left: (left / 2) + "px", top: 0});
                //    } else {
                //        $background.css({left: 0, top: 0});
                //    }
                //} else {
                    var top = panelHeight - (panelWidth / width) * height;
                    $background.css({width: panelWidth + "px", height: "auto"});
                    if (top < 0) {
                        $background.css({top: (top / 2) + "px", left: 0});
                    } else {
                        $background.css({left: 0, top: 0});
                    }
                //}
            }

Uncommenting the lines i have no issues.

Why these lines are commented? May i change the file?

designguy79's picture
designguy79
Mon, 07/13/2015 - 14:05

I upgraded to 2.18 today and was banging my head against the wall trying to get the "full width" feature to work again, but gave up and went back to 2.17.

I guess I will just ignore Drupal telling me that my modules need upgrading, and hope for the best for version 2.19!

-- DG79

phuonght's picture
phuonght
Mon, 07/13/2015 - 23:16

JohnnyGlemoure and Designguy79,

Thank you for your feedback.

We are checking and will reply ASAP.

tylerb's picture
tylerb
Tue, 07/14/2015 - 20:35

I also want to report the same issue. 

phuonght's picture
phuonght
Wed, 07/15/2015 - 06:23

Hi,

We checked and it is our fault, please help us uncomment below lines in 2.18 version:

if (height > 0 && panelHeight > 0) {

                //if (((width / height) > (panelWidth / panelHeight))) {
                //    var left = panelWidth - (panelHeight / height) * width;
                //    $background.css({
                //        width: "auto",
                //        height: panelHeight + "px"
                //    });
                //    if (left < 0) {
                //        $background.css({left: (left / 2) + "px", top: 0});
                //    } else {
                //        $background.css({left: 0, top: 0});
                //    }
                //} else {
                    var top = panelHeight - (panelWidth / width) * height;
                    $background.css({width: panelWidth + "px", height: "auto"});
                    if (top < 0) {
                        $background.css({top: (top / 2) + "px", left: 0});
                    } else {
                        $background.css({left: 0, top: 0});
                    }
                //}
            }

JohnnyGlemoure's picture
JohnnyGlemoure
Wed, 07/15/2015 - 09:40

Ok, thank you. 

Now i can use the 2.18 in the production server.

designguy79's picture
designguy79
Mon, 07/20/2015 - 14:15

For anyone struggling on how to apply this patch, the following worked for me:

1. Open file js/md-slider.dev.js in a text editor

2. Delete the two slashes on lines 1511 through 1522 and on line 1530

3. Copy the entire contents of the file your clipboard

4. Go to http://jscompress.com and paste the contents

5. Click on "Compress Javascript" and then on "Download .JS" file

6. Delete the file js/md-slider.js

7. Rename the file downloaded from jscompress.com as md-slider.js and move the js folder

Should be good to go!

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.