{"action":"opened","issue":{"url":"https://api.github.com/repos/GetmeUK/ContentTools/issues/323","repository_url":"https://api.github.com/repos/GetmeUK/ContentTools","labels_url":"https://api.github.com/repos/GetmeUK/ContentTools/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/GetmeUK/ContentTools/issues/323/comments","events_url":"https://api.github.com/repos/GetmeUK/ContentTools/issues/323/events","html_url":"https://github.com/GetmeUK/ContentTools/issues/323","id":179745292,"number":323,"title":"Upload image single/double quote issue","user":{"login":"megamuf","id":13167613,"avatar_url":"https://avatars.githubusercontent.com/u/13167613?v=3","gravatar_id":"","url":"https://api.github.com/users/megamuf","html_url":"https://github.com/megamuf","followers_url":"https://api.github.com/users/megamuf/followers","following_url":"https://api.github.com/users/megamuf/following{/other_user}","gists_url":"https://api.github.com/users/megamuf/gists{/gist_id}","starred_url":"https://api.github.com/users/megamuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/megamuf/subscriptions","organizations_url":"https://api.github.com/users/megamuf/orgs","repos_url":"https://api.github.com/users/megamuf/repos","events_url":"https://api.github.com/users/megamuf/events{/privacy}","received_events_url":"https://api.github.com/users/megamuf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-28T11:17:57Z","updated_at":"2016-09-28T11:17:57Z","closed_at":null,"body":"While implementin imaqge upload we ran into a very strange behaviour - on some computers (In our case all of them were laptops) the backgroun image wouldn't show up. By inspection the code we see that:\r\n```\r\n<div class=\"some specific classes\" style='background-image:url(\"path/to/image\")' />\r\n```\r\n\r\nif we manually revert the usage  of double/single quotes (in inspector) then the image is rendered OK.\r\n\r\nThe strangest is that this behaviour remains in all browsers and all computers have windows 10 installed.\r\n\r\n- It works well on desktop computers.\r\n- It fails on laptops.\r\n\r\nHow can we fix this strange behaviour?\r\n\r\nP.S. Here is our imageuploader.fileready code (almos as in the example)\r\n\r\n```javascript\r\n\r\ndialog.addEventListener('imageuploader.fileready', function (ev) {\r\n        $('.ct-dialog__close').unbind('click');\r\n        // Upload a file to the server\r\n        var formData;\r\n        var file = ev.detail().file;\r\n        //console.log(file)\r\n\r\n        // Define functions to handle upload progress and completion\r\n        xhrProgress = function (ev) {\r\n            // Set the progress for the upload\r\n            dialog.progress((ev.loaded / ev.total) * 100);\r\n        };\r\n\r\n        xhrComplete = function (ev) {\r\n            var response;\r\n\r\n            // Check the request is complete\r\n            if (ev.target.readyState != 4) {\r\n\r\n                return;\r\n            }\r\n\r\n            // Clear the request\r\n            xhr = null;\r\n            xhrProgress = null;\r\n            xhrComplete = null;\r\n\r\n            // Handle the result of the upload\r\n            if (parseInt(ev.target.status) == 200) {\r\n                // Unpack the response (from JSON)\r\n                response = JSON.parse(ev.target.responseText);\r\n                imageResponse = response;\r\n                //console.log(response);\r\n                //response = JSON.parse(ev.target.responseText);\r\n                //console.log(response)\r\n\r\n                // Store the image details\r\n                image = {\r\n                    size: [response.width, response.height],\r\n                    url: response.url\r\n                };\r\n\r\n                // Populate the dialog\r\n                dialog.populate(image.url, image.size);\r\n                $('.ct-dialog__close').on('click', function () {\r\n                    $('.ct-control--clear').trigger('click');\r\n                });\r\n\r\n            } else {\r\n                // The request failed, notify the user\r\n                new ContentTools.FlashUI('no');\r\n                $('.ct-control--cancel').on('click', function () {\r\n                    $('.ct-dialog__close').trigger('click');\r\n                });\r\n\r\n            }\r\n        };\r\n```"}}
{"actor":{"display_login":"megamuf"}}