mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-25 22:36:59 -04:00
rjs -> webpack
This commit is contained in:
@@ -1,38 +1,29 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'jquery',
|
||||
'vent',
|
||||
'Shared/FileBrowser/FileBrowserLayout',
|
||||
'Mixins/DirectoryAutoComplete'
|
||||
], function ($, vent) {
|
||||
var $ = require('jquery');
|
||||
var vent = require('../vent');
|
||||
require('../Shared/FileBrowser/FileBrowserLayout');
|
||||
require('./DirectoryAutoComplete');
|
||||
|
||||
$.fn.fileBrowser = function (options) {
|
||||
module.exports = (function(){
|
||||
$.fn.fileBrowser = function(options){
|
||||
var inputs = $(this);
|
||||
|
||||
inputs.each(function () {
|
||||
inputs.each(function(){
|
||||
var input = $(this);
|
||||
var inputOptions = $.extend({ input: input }, options);
|
||||
|
||||
var inputOptions = $.extend({input : input}, options);
|
||||
var inputGroup = $('<div class="input-group"></div>');
|
||||
var inputGroupButton = $('<span class="input-group-btn "></span>');
|
||||
var button = $('<button class="btn btn-primary x-file-browser" title="Browse"><i class="icon-folder-open"/></button>');
|
||||
|
||||
if (input.parent('.input-group').length > 0) {
|
||||
if(input.parent('.input-group').length > 0) {
|
||||
input.parent('.input-group').find('.input-group-btn').prepend(button);
|
||||
}
|
||||
|
||||
else {
|
||||
inputGroupButton.append(button);
|
||||
input.wrap(inputGroup);
|
||||
input.after(inputGroupButton);
|
||||
}
|
||||
|
||||
button.on('click', function () {
|
||||
button.on('click', function(){
|
||||
vent.trigger(vent.Commands.ShowFileBrowser, inputOptions);
|
||||
});
|
||||
});
|
||||
|
||||
inputs.directoryAutoComplete();
|
||||
};
|
||||
});
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user