Private GIT

Skip to content
Snippets Groups Projects
Commit d9f62a49 authored by Alison Winters's avatar Alison Winters
Browse files

fix bug where if you update using autocomplete first, then the file browser is out of sync

parent ebf55270
No related merge requests found
......@@ -146,7 +146,7 @@
};
}
var initialDir, path, callback, ls = false;
var path, callback, ls = false;
// if the text field is empty and we're given a key then populate it with the last browsed value from localStorage
try { ls = !!(localStorage.getItem); } catch (e) {}
if (ls && options.key) {
......@@ -167,13 +167,11 @@
};
initialDir = options.field.val() || (options.key && path) || '';
options = $.extend(options, {initialDir: initialDir});
// append the browse button and give it a click behaviour
return options.field.addClass('fileBrowserField').after($('<input type="button" value="Browse&hellip;" class="btn btn-inline fileBrowser" />').click(function () {
$(this).nFileBrowser(callback, options);
var initialDir = options.field.val() || (options.key && path) || '';
var optionsWithInitialDir = $.extend({}, options, {initialDir: initialDir});
$(this).nFileBrowser(callback, optionsWithInitialDir);
return false;
}));
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment