},
function(result) {
if (result.status === 'success') {
- FileList.add(result.data, {hidden: hidden, animate: true});
+ FileList.add(result.data, {hidden: hidden, animate: true, scrollTo: true});
} else {
OC.dialogs.alert(result.data.message, t('core', 'Could not create file'));
}
},
function(result) {
if (result.status === 'success') {
- FileList.add(result.data, {hidden: hidden, animate: true});
+ FileList.add(result.data, {hidden: hidden, animate: true, scrollTo: true});
} else {
OC.dialogs.alert(result.data.message, t('core', 'Could not create folder'));
}
*
* @param fileData map of file attributes
* @param options map of attributes:
- * - "updateSummary": true to update the summary after adding (default), false otherwise
- * - "silent": true to prevent firing events like "fileActionsReady"
- * - "animate": true to animate preview loading (defaults to true here)
+ * @param options.updateSummary true to update the summary after adding (default), false otherwise
+ * @param options.silent true to prevent firing events like "fileActionsReady"
+ * @param options.animate true to animate preview loading (defaults to true here)
+ * @param options.scrollTo true to automatically scroll to the file's location
* @return new tr element (not appended to the table)
*/
add: function(fileData, options) {
});
}
+ if (options.scrollTo) {
+ this.scrollTo(fileData.name);
+ }
+
// defaults to true if not defined
if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) {
this.fileSummary.add(fileData, true);