- _initFileUploadButtonBar: function () {
- var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
- filesList = this.element.find('.files'),
- ns = this.options.namespace;
- fileUploadButtonBar
- .addClass('ui-widget-header ui-corner-top');
- this.element.find('.fileinput-button').each(function () {
- var fileInput = $(this).find('input:file').detach();
- $(this).button({icons: {primary: 'ui-icon-plusthick'}})
- .append(fileInput);
- });
- fileUploadButtonBar.find('.start')
- .button({icons: {primary: 'ui-icon-circle-arrow-e'}})
- .bind('click.' + ns, function (e) {
- e.preventDefault();
- filesList.find('.start button').click();
- });
- fileUploadButtonBar.find('.cancel')
- .button({icons: {primary: 'ui-icon-cancel'}})
- .bind('click.' + ns, function (e) {
- e.preventDefault();
- filesList.find('.cancel button').click();
- });
- fileUploadButtonBar.find('.delete')
- .button({icons: {primary: 'ui-icon-trash'}})
- .bind('click.' + ns, function (e) {
- e.preventDefault();
- filesList.find('.delete button').click();
- });
- },
-
- _destroyFileUploadButtonBar: function () {
- this.element.find('.fileupload-buttonbar')
- .removeClass('ui-widget-header ui-corner-top');
- this.element.find('.fileinput-button').each(function () {
- var fileInput = $(this).find('input:file').detach();
- $(this).button('destroy')
- .append(fileInput);
- });
- this.element.find('.fileupload-buttonbar button')
- .unbind('click.' + this.options.namespace)
- .button('destroy');
- },
-
- _enableFileInputButton: function () {
- this.element.find('.fileinput-button input:file:disabled')
- .each(function () {
- var fileInput = $(this),
- button = fileInput.parent();
- fileInput.detach().prop('disabled', false);
- button.button('enable').append(fileInput);
- });
- },
-
- _disableFileInputButton: function () {
- this.element.find('.fileinput-button input:file:enabled')
- .each(function () {
- var fileInput = $(this),
- button = fileInput.parent();
- fileInput.detach().prop('disabled', true);
- button.button('disable').append(fileInput);
- });
- },
-