{"action":"created","issue":{"url":"https://api.github.com/repos/yabwe/medium-editor/issues/1130","repository_url":"https://api.github.com/repos/yabwe/medium-editor","labels_url":"https://api.github.com/repos/yabwe/medium-editor/issues/1130/labels{/name}","comments_url":"https://api.github.com/repos/yabwe/medium-editor/issues/1130/comments","events_url":"https://api.github.com/repos/yabwe/medium-editor/issues/1130/events","html_url":"https://github.com/yabwe/medium-editor/issues/1130","id":162695565,"number":1130,"title":"Get \"ncaught IndexSizeError\" after upgraded to latest version when clicking on the image","user":{"login":"daituzhang","id":4118473,"avatar_url":"https://avatars.githubusercontent.com/u/4118473?v=3","gravatar_id":"","url":"https://api.github.com/users/daituzhang","html_url":"https://github.com/daituzhang","followers_url":"https://api.github.com/users/daituzhang/followers","following_url":"https://api.github.com/users/daituzhang/following{/other_user}","gists_url":"https://api.github.com/users/daituzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/daituzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daituzhang/subscriptions","organizations_url":"https://api.github.com/users/daituzhang/orgs","repos_url":"https://api.github.com/users/daituzhang/repos","events_url":"https://api.github.com/users/daituzhang/events{/privacy}","received_events_url":"https://api.github.com/users/daituzhang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-28T14:10:56Z","updated_at":"2016-07-07T23:36:45Z","closed_at":null,"body":"### Description\r\nCan not style the image,\r\nWhen click on the image\r\nconsole showed \r\n```\r\njquery.min.js:2 Uncaught TypeError: Cannot read property 'ownerDocument' of undefined\r\n```\r\nsometimes showed error \r\n```\r\nmedium-editor-insert-plugin.min.js:10 Uncaught IndexSizeError: Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index.\r\n```\r\n\r\n### Steps to reproduce\r\n\r\n1. All settings work on Version 4.8.1\r\nOption settings:\r\n```js\r\nvar editor = new MediumEditor('div#postData', {\r\n\t \t\tbuttons: ['bold', 'italic', 'underline', 'anchor', 'header1', 'header2', 'quote', 'unorderedlist', 'orderedlist'],\r\n            buttonLabels: 'fontawesome', \r\n\t\t\tspellcheck:true,\r\n\t\t\tanchorInputPlaceholder: 'Enter the url here',\r\n\t\t\ttargetBlank: true,\r\n\t\t\tanchor: {\r\n\t\t\t\tlinkValidation: true\r\n    \t\t}\r\n     });\r\n\t \r\n\r\n    \r\n    \r\n\r\n\t $(function () {\r\n            $('div#postData').mediumInsert({\r\n                editor: editor,\r\n\t\t\t\t actions: null,\r\n                 addons: {\r\n                    images: {\r\n                        uploadScript: null,\r\n                        deleteScript: null,\r\n\t\t\t\t\t\taddons: { // (object) Addons configuration\r\n        images: { // (object) Image addon configuration\r\n            label: '<span class=\"fa fa-camera\"></span>', // (string) A label for an image addon\r\n            uploadScript: null, // DEPRECATED: Use fileUploadOptions instead\r\n            deleteScript: 'includes/delete.php', // (string) A relative path to a delete script\r\n            preview: true, // (boolean) Show an image before it is uploaded (only in browsers that support this feature)\r\n            captions: true, // (boolean) Enable captions\r\n            captionPlaceholder: 'Type caption for image (optional)', // (string) Caption placeholder\r\n            autoGrid: 3, // (integer) Min number of images that automatically form a grid\r\n            formData: {}, // DEPRECATED: Use fileUploadOptions instead\r\n            fileUploadOptions: { // (object) File upload configuration. See https://github.com/blueimp/jQuery-File-Upload/wiki/Options\r\n                url: 'upload.php', // (string) A relative path to an upload script\r\n                acceptFileTypes: /(\\.|\\/)(gif|jpe?g|png)$/i // (regexp) Regexp of accepted file types\r\n            },\r\n            styles: { // (object) Available image styles configuration\r\n                wide: { // (object) Image style configuration. Key is used as a class name added to an image, when the style is selected (.medium-insert-images-wide)\r\n                    label: '<span class=\"fa fa-align-justify\"></span>', // (string) A label for a style\r\n                    added: function ($el) {}, // (function) Callback function called after the style was selected. A parameter $el is a current active paragraph (.medium-insert-active)\r\n                    removed: function ($el) {} // (function) Callback function called after a different style was selected and this one was removed. A parameter $el is a current active paragraph (.medium-insert-active)\r\n                },\r\n                left: {\r\n                    label: '<span class=\"fa fa-align-left\"></span>'\r\n                },\r\n                right: {\r\n                    label: '<span class=\"fa fa-align-right\"></span>'\r\n                },\r\n                grid: {\r\n                    label: '<span class=\"fa fa-th\"></span>'\r\n                }\r\n            },\r\n            actions: { // (object) Actions for an optional second toolbar\r\n                remove: { // (object) Remove action configuration\r\n                    label: '<span class=\"fa fa-times\"></span>', // (string) Label for an action\r\n                    clicked: function ($el) { // (function) Callback function called when an action is selected\r\n                        var $event = $.Event('keydown');\r\n\r\n                        $event.which = 8;\r\n                        $(document).trigger($event);   \r\n                    }\r\n                }\r\n            },\r\n            messages: {\r\n                acceptFileTypesError: 'This file is not in a supported format: ',\r\n                maxFileSizeError: 'This file is too big: '\r\n            },\r\n            uploadCompleted: function ($el, data) {} // (function) Callback function called when upload is completed\r\n        }\r\n\t\t\t\t\t\t}\r\n                       \r\n                    }\r\n                }\r\n            });\r\n        });\r\n```\r\n\r\n2. upgrade to the latest version on cdn\r\n3. image editor broke\r\n\r\n### Versions\r\n\r\n- medium-editor: latest version on cdn\r\n- browser: chrome\r\n- OS: os x 10.11.3\r\n"},"comment":{"url":"https://api.github.com/repos/yabwe/medium-editor/issues/comments/231238408","html_url":"https://github.com/yabwe/medium-editor/issues/1130#issuecomment-231238408","issue_url":"https://api.github.com/repos/yabwe/medium-editor/issues/1130","id":231238408,"user":{"login":"nmielnik","id":2444240,"avatar_url":"https://avatars.githubusercontent.com/u/2444240?v=3","gravatar_id":"","url":"https://api.github.com/users/nmielnik","html_url":"https://github.com/nmielnik","followers_url":"https://api.github.com/users/nmielnik/followers","following_url":"https://api.github.com/users/nmielnik/following{/other_user}","gists_url":"https://api.github.com/users/nmielnik/gists{/gist_id}","starred_url":"https://api.github.com/users/nmielnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmielnik/subscriptions","organizations_url":"https://api.github.com/users/nmielnik/orgs","repos_url":"https://api.github.com/users/nmielnik/repos","events_url":"https://api.github.com/users/nmielnik/events{/privacy}","received_events_url":"https://api.github.com/users/nmielnik/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T23:36:45Z","updated_at":"2016-07-07T23:36:45Z","body":"@daituzhang does this reproduce with just medium-editor (without the medium-editor-plugin)?  If it doesn't could you open this issue against that project?"}}
{"actor":{"display_login":"nmielnik"}}