Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
Add custom CSS class to ui-igstartupbrowsebutton
posted

Im using the igUpload on a responsive site together with fastclick (https://github.com/ftlabs/fastclick) to eliminate the 300ms delay between a physical tap and the firing of a click event on mobile browsers.

The problem is that it wont work correctly with igstartupbrowsebutton. The click event is never fired correctly on iOs.

Im rendering the upload with 

    $.ig.loader('igUpload', function() {

        $('#projectImage').igUpload({

            mode: 'multiple',

            css: {

                "what_name_should_i_use_here": "needsclick" // Does not work

            },

            multipleFiles: true,

            maxSimultaneousFilesUploads: 1,

            maxUploadedFiles: 50,

            autostartupload: true,

            labelUploadButton: 'Submit photos',

            controlId: 'projectImage',

            progressUrl: '/IGUploadStatusHandler.ashx',

allowedExtensions: [ 'jpg', 'JPG', 'jpeg', 'JPEG' ]

        });

    });

<button id="projectImage_ibb" class="ui-igstartupbrowsebutton ui-button-text-only ui-button ui-igbutton ui-widget ui-widget-content ui-corner-all ui-state-default" title="Upload File" role="button" aria-disabled="false"><span class="ui-button-text" id="projectImage_ibb_lbl"><span class="glyphicon glyphicon-upload"></span> Submit photos</span></button>

The problem is that i need to add a custom class to browsebutton to prevent FastClick on the specific element. Eg:

<button id="projectImage_ibb" class="ui-igstartupbrowsebutton ui-button-text-only ui-button ui-igbutton ui-widget ui-widget-content ui-corner-all ui-state-default needsclick" title="Upload File" role="button" aria-disabled="false"><span class="ui-button-text" id="projectImage_ibb_lbl"><span class="glyphicon glyphicon-upload"></span> Submit photos</span></button>