{"action":"created","issue":{"url":"https://api.github.com/repos/moxiecode/plupload/issues/1254","labels_url":"https://api.github.com/repos/moxiecode/plupload/issues/1254/labels{/name}","comments_url":"https://api.github.com/repos/moxiecode/plupload/issues/1254/comments","events_url":"https://api.github.com/repos/moxiecode/plupload/issues/1254/events","html_url":"https://github.com/moxiecode/plupload/issues/1254","id":87701010,"number":1254,"title":"Plupload 2.1.4: Select files button doesn't work when it is inside a jquery ","user":{"login":"BabuSujith","id":12392849,"avatar_url":"https://avatars.githubusercontent.com/u/12392849?v=3","gravatar_id":"","url":"https://api.github.com/users/BabuSujith","html_url":"https://github.com/BabuSujith","followers_url":"https://api.github.com/users/BabuSujith/followers","following_url":"https://api.github.com/users/BabuSujith/following{/other_user}","gists_url":"https://api.github.com/users/BabuSujith/gists{/gist_id}","starred_url":"https://api.github.com/users/BabuSujith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BabuSujith/subscriptions","organizations_url":"https://api.github.com/users/BabuSujith/orgs","repos_url":"https://api.github.com/users/BabuSujith/repos","events_url":"https://api.github.com/users/BabuSujith/events{/privacy}","received_events_url":"https://api.github.com/users/BabuSujith/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-12T11:31:48Z","updated_at":"2015-06-22T07:10:52Z","closed_at":null,"body":"Plupload: Select files button doesn't work when it is inside a jquery modal in ipad\r\n\r\nHi I am using Plupload for uploading images in my application. And it's working fine in IE, chrome and firefox etc. But when I test my application in Ipad safari, \"Add Files\" button is not triggering. But in Ipad, if I use chrome as my browser, it's working. I am using a jquery modal pop-up to show the plupload widget (the jquery modal poup up will appear when I click \"Upload Images\" button from my application. \r\n\r\nI tried to refresh the upload after you open the dialog, but still it's not working\r\n\r\nDo I need to do any additional code. Please advise\r\n\r\nCode:\r\n    function fnOpenUploadPopUp(val, msg) {\r\n        $(\"#DocType\").val(val);\r\n        $('#HeaderMessage').html(msg);\r\n        $(\"#dialog-upload\").dialog(\"open\");\r\n        $('#uploader').plupload('refresh');\r\n    } \r\n\r\nPlupload initializing\r\n------------------------------\r\n\r\n\r\n@*<div id=\"dialog-upload\">\r\n    <div id=\"UserMessage\"></div>\r\n    <span id=\"boxMI\"></span>\r\n    <table style=\"border: 5px solid #ededed;\">\r\n        <tbody>\r\n            <tr class=\"upld_section\">\r\n                <td class=\"upload-tabs-rt\">\r\n\r\n                    <div class=\"examples examples-ui\" id=\"up-ui\">\r\n                        <section id=\"content\">\r\n                            <div class=\"container\">\r\n                                <div id=\"example\">\r\n                                    <div id=\"uploader\">\r\n                                        <p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>\r\n                                    </div>\r\n                                    <script type=\"text/javascript\">\r\n                    // Initialize the widget when the DOM is ready\r\n                    $(function () {\r\n                        var ETA = 0;\r\n                        var count = 1;\r\n                        var index = 0;\r\n                        var text = \"\";\r\n                        var regex = /(?:\\.([^.]+))?$/;\r\n                        var datetime = @DateTime.Now.ToString(\"MMddyyyyhhmmss\") + '';\r\n\r\n                        $(\"#uploader\").plupload({\r\n                            // General settings\r\n                            runtimes: 'html5,flash,silverlight,html4',\r\n                            url: \"@Url.Action(\"UploadToDocVault\", \"healthrecord\", new { area = \"\", id = Model.Patient.PersonId }, true)\",\r\n                            // Maximum file size\r\n                            max_file_size: '1000mb',\r\n                            chunk_size: '200mb',\r\n                            max_retries: 3,\r\n                            // Rename files by clicking on their titles\r\n                            rename: true,\r\n                            // Sort files\r\n                            sortable: true,\r\n                            // Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)\r\n                            dragdrop: true,\r\n                            // Views to activate\r\n                            views: {\r\n                                list: true,\r\n                                thumbs: true, // Show thumbs\r\n                                active: 'thumbs'\r\n                            },\r\n                            multiple_queues: true,\r\n                            multipart: true,\r\n                            multipart_params: { taskId: '' },\r\n                            rename: true,\r\n\r\n                            preinit: {\r\n                                FilesAdded: function (up, files) {\r\n                                    if ($('#DocType').val() == 0) {\r\n                                        $('#DocType').val(5);\r\n                                    }\r\n                                    var i = 0;\r\n                                    $.each(files, function (i, file) {\r\n                                        //if ($('#DocType').val() == 5) {\r\n                                        var name = file.name.substr(0, file.name.lastIndexOf('.')) || file.name;\r\n                                        var ext = regex.exec(file.name)[1];\r\n                                        //var fName = name + count + '_' + i;\r\n                                        var fName = name + '_' + datetime + count + i;\r\n                                        file.name = (ext == undefined) ? fName : fName + '.' + ext;\r\n                                        //}\r\n                                        file.name = file.name + '|' + $('#DocType').val() + \":\" + count;\r\n\r\n                                        //for imaging just show only one file and hide all others\r\n                                        if (i > 0 && $('#DocType').val() == 5) {\r\n                                            $('#' + file.id).hide();\r\n                                        }\r\n                                        i = i + 1;\r\n                                    });\r\n                                    count = count + 1;\r\n                                },\r\n                                UploadProgress: function (up, file) {\r\n                                    if (up.total.bytesPerSec > 0) {\r\n                                        var time_left_seconds_overall = Math.round((up.total.size - up.total.loaded) / up.total.bytesPerSec);\r\n                                        ETA = time(time_left_seconds_overall);\r\n                                    } else {\r\n                                        ETA = 0.1;\r\n                                    }\r\n\r\n                                    var msg = '<div class=\"box info noicon\" id=\"info\">' +\r\n                                                '<span style=\"position: relative;bottom:8px;\">Your file(s) are being uploaded. Please wait...</span>' +\r\n                                                '&nbsp;&nbsp;<img src=\"@Url.Content(\"~/content/images/Spinner.gif\")\" />';\r\n                                    msg = msg + '&nbsp;&nbsp;<span style=\"position: relative;bottom:8px;\">Estimated time: ' + ETA + '</span>';\r\n                                    msg = msg + '<div class=\"close\" onclick=\"fnClose()\" id=\"btnclose\">X</div></div>';\r\n                                    $(\"#UserMessage\").empty();\r\n                                    $(\"#UserMessage\").css(\"display\", \"block\");\r\n                                    $('#UserMessage').html(msg);\r\n                                },\r\n                                FileUploaded: function (up, file, response) {\r\n                                    var fileName = file.name.split('|')[0];\r\n                                    var docType = file.name.split('|')[1].split(':')[0];\r\n                                    var ident = file.name.split('|')[1].split(':')[1];\r\n                                    if (docType == 5 && index != ident) {\r\n                                        text = '@DateTime.Now.ToString(\"yyyyMMddHHmmss\")' + ident;\r\n                                        index = ident;\r\n                                    }\r\n\r\n                                    $.ajax({\r\n                                        url: '@Url.Action(\"InsertMedicalDoc\", \"healthrecord\", new { area = \"\", id = Model.Patient.PersonId }, true)',\r\n                                        data: \"{ 'filename': '\" + fileName + \"','docType': '\" + docType + \"','text': '\" + text + \"' }\",\r\n                                        type: 'POST',\r\n                                        dataType: \"json\",\r\n                                        contentType: 'application/json; charset=utf-8'\r\n                                    });\r\n                                    keepSignedIn(false);\r\n                                },\r\n                                UploadComplete: function (up, files) {\r\n                                    if (up.files.length == (up.total.uploaded + up.total.failed) && up.total.uploaded > 0) {\r\n                                        $(\"#UserMessage\").empty();\r\n                                        $(\"#UserMessage\").css(\"display\", \"block\");\r\n                                        $('#UserMessage').html('<div class=\"box warning gn-icon gn-icon-warning\" id=\"warning1\">' +\r\n                                                                'Please wait while we process your record(s). Dont refresh the page, this may take some time.' +\r\n                                                                '</div>');\r\n                                        $.ajax({\r\n                                            url: '@Url.Action(\"CompleteUploadProcess\", \"healthrecord\", new { area = \"\", id = Model.Patient.PersonId }, true)',\r\n                                            type: 'GET',\r\n                                            contentType: 'application/json; charset=utf-8',\r\n                                            success: function (data) {\r\n                                                $('#placeHolder').empty();\r\n                                                $('#placeHolder').html(data);\r\n                                                $(\"#UserMessage\").empty();\r\n                                                $(\"#UserMessage\").css(\"display\", \"block\");\r\n                                                $('#UserMessage').html('<div class=\"box success\" id=\"success\">' +\r\n                                                                        '<div class=\"gn-icon gn-icon-thumbsup\">Your file(s) have been successfully uploaded.' +\r\n                                                                        '<div class=\"close\" onclick=\"fnClose()\" id=\"btnclose\">X</div></div>');\r\n                                                document.getElementById(\"med_rec_vault\").style.display = \"block\";\r\n                                                scrollTo(0);\r\n                                                setArrows();\r\n                                            },\r\n                                            error: function (response) {\r\n                                                $(\"#UserMessage\").empty();\r\n                                                $(\"#UserMessage\").css(\"display\", \"block\");\r\n                                                $('#UserMessage').html('<div class=\"box error\" id=\"error\">' +\r\n                                                                        '<div class=\"gn-icon gn-icon-close\">Oops, something went wrong. Please try again later or contact support@secondopinionexpert.com.' +\r\n                                                                        '<div class=\"close\" onclick=\"fnClose()\" id=\"btnclose\">X</div></div>');\r\n                                                setArrows();\r\n                                            }\r\n                                        });\r\n                                        $.each(files, function (i, file) {\r\n                                            $('#' + file.id).remove();\r\n                                        });\r\n                                        up.splice();\r\n                                        up.refresh();\r\n                                    }\r\n                                }\r\n                            },\r\n                            error: function () {\r\n\r\n                            },\r\n                            stop: function () {\r\n                                fnAjaxBegin('Cancel Upload in progress...');\r\n                                $(\"#UserMessage\").empty();\r\n                                $(\"#UserMessage\").css(\"display\", \"none\");\r\n                                $.ajax({\r\n                                    url: '@Url.Action(\"CancelMedicalDocs\", \"healthrecord\", new { area = \"\", id = Model.Patient.PersonId }, true)',\r\n                                    data: \"{ 'healthProfile': '\" + @Model.FromHealthProfile + \"' }\",\r\n                                    type: 'POST',\r\n                                    dataType: \"json\",\r\n                                    contentType: 'application/json; charset=utf-8',\r\n                                    success: function (result) {\r\n                                        if (typeof (result.url) != 'undefined') {\r\n                                            hidelAll();\r\n                                            window.location.href = result.url;\r\n                                            showSuccess('Upload cancelled.');\r\n                                        }\r\n                                        setArrows();\r\n                                    },\r\n                                    error: function (response) {\r\n                                        hideBusyBarOvrly();\r\n                                        hideBusyBar();\r\n                                        setArrows();\r\n                                    }\r\n                                });\r\n                            }\r\n                        });\r\n                        //$('#uploader').plupload('refresh');\r\n                        //$('#uploader > div.plupload browse_button').css('z-index', '99999!important');\r\n                    });\r\n                                    </script>\r\n                                </div>\r\n                            </div>\r\n                        </section>\r\n                    </div>\r\n\r\n                </td>\r\n            </tr>\r\n        </tbody>\r\n    </table>\r\n</div>*@"},"comment":{"url":"https://api.github.com/repos/moxiecode/plupload/issues/comments/114024740","html_url":"https://github.com/moxiecode/plupload/issues/1254#issuecomment-114024740","issue_url":"https://api.github.com/repos/moxiecode/plupload/issues/1254","id":114024740,"user":{"login":"jayarjo","id":150075,"avatar_url":"https://avatars.githubusercontent.com/u/150075?v=3","gravatar_id":"","url":"https://api.github.com/users/jayarjo","html_url":"https://github.com/jayarjo","followers_url":"https://api.github.com/users/jayarjo/followers","following_url":"https://api.github.com/users/jayarjo/following{/other_user}","gists_url":"https://api.github.com/users/jayarjo/gists{/gist_id}","starred_url":"https://api.github.com/users/jayarjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayarjo/subscriptions","organizations_url":"https://api.github.com/users/jayarjo/orgs","repos_url":"https://api.github.com/users/jayarjo/repos","events_url":"https://api.github.com/users/jayarjo/events{/privacy}","received_events_url":"https://api.github.com/users/jayarjo/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T07:10:52Z","updated_at":"2015-06-22T07:10:52Z","body":"You should call `refresh` only after the dialog is shown, otherwise it's useless. Attach an event lister to the [open](http://api.jqueryui.com/dialog/#event-open) event of UI Dialog and call `refresh` from there."}}