.append( insert )
.appendTo( ul );
};
- if (link) {
+ if (link && linksAllowed) {
$('#email').autocomplete({
minLength: 1,
source: function (search, response) {
autocompleteStub = sinon.stub($.fn, 'autocomplete', function() {
// dummy container with the expected attributes
+ if (!$(this).length) {
+ // simulate the real autocomplete that returns
+ // nothing at all when no element is specified
+ // (and potentially break stuff)
+ return null;
+ }
var $el = $('<div></div>').data('ui-autocomplete', {});
return $el;
});
'file',
123,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'shared_file_name.txt'
);
'file',
123,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'shared_file_name.txt'
);
'file',
123,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'shared_file_name.txt'
);
'file',
123,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'shared_file_name.txt'
);
'file',
123,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'folder'
);
'file',
456, // another file
$container,
- 'http://localhost/dummylink',
+ true,
31,
'folder'
);
'folder',
123,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'folder'
);
'file',
456,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'file_in_folder.txt'
);
'file',
123,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'folder'
);
'file',
123,
$container,
- 'http://localhost/dummylink',
+ true,
31,
'shared_file_name.txt'
);