summaryrefslogtreecommitdiffstats
path: root/apps/files/js/breadcrumb.js
Commit message (Collapse)AuthorAgeFilesLines
* Improve documentation of "getTotalWidth"Daniel Calviño Sánchez2018-03-011-1/+4
| | | | | | | | | | "getTotalWidth" is not more accurate; it is simply not clamped. Moreover, "width/outerWidth" could be used in tests too, and also even if "getTotalWidth" could be used in tests while others not that would not be something to be stated in the API documentation, but in a comment. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Do not show the crumbs again after hiding themDaniel Calviño Sánchez2018-03-011-6/+0
| | | | | | | | | | | | | | | | | | | After the changes in the previous commit "_showCrumb" no longer shows the menu, only the same crumb that was hidden by the last call to "_hideCrumb". Therefore, if the crumb was hidden because it did not fit there is no need to try to show it again, as it will still not fit. Moreover, the calculated width for a hidden element is not always accurate; in some cases the calculated width is lower than the actual width (it happens, for example, when using a background image like the "Share" icon), which causea the crumb to be shown even if there is not enough room, which in the end causes the siblings to overflow the contents. No unit tests for this one, though; you will have to trust me on this, sorry ;-) Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix menu visibilityDaniel Calviño Sánchez2018-03-011-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | The crumb for the menu was shown like any other crumb when calling "_showCrumb", but it was also shown when other crumbs were hidden without taking into account the available width. This caused several related problems, like the breadcrumbs taking too much space when the menu was sometimes shown after the rest of the crumbs were adjusted to the available width, or the menu being shown instead of the last crumb even if there was room for it when the available width was increased. Now the menu is always hidden before starting the resizing of the crumbs to ensure that whether it was previously shown or not does not affect the result. In a similar way, the menu will no longer be shown by "_showCrumb", as it is not a regular crumb that has to be shown simply if there is enough room. The menu is now shown as soon as any other crumb is hidden; this ensures that the menu width will be taken into account in further width checks. As when _updateMenu" is called it no longer needs to take care of showing the menu this fixes the issue revealed when fixing the test setup in the previous commit. Finally, this implicitly fixes the failure in the breadcrumbs tests when run on Firefox, as it was caused by the menu interfering in the calculations of the other crumbs when increasing the width. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Take padding and margins of crumbs into accountDaniel Calviño Sánchez2018-03-011-2/+2
| | | | | | | | | When calculating the total width of the crumbs only its padding was taken into account; now the margin is too. In a similar way, before showing a crumb only its width was taken into account; now its padding and margin are taken into account too. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Compress siblings before calculating the available width for crumbsDaniel Calviño Sánchez2018-03-011-0/+9
| | | | | | | | | | | | | | | | When the parent element of the breadcrumbs was resized to a larger width and the siblings of the breadcrumbs expanded to fill all the available width some crumbs could be hidden even if there was enough room for them. The reason was that the width of the siblings being used to calculate the available width for the breadcrumbs was the expanded width of the siblings. Now as many crumbs as possible (that is, fitting in the parent, no matter the siblings) are first shown so the expanding siblings are compressed before calculating the available width. Due to the lack of support for flexboxes in PhantomJS the related unit test is skipped; it has to be run in other browser, like Firefox. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Take all visible siblings into accountDaniel Calviño Sánchez2018-03-011-1/+9
| | | | | | | | | Other apps could add elements to the controls outside the creatable actions div (for example, the button to switch to the gallery), so the widths of all the visible siblings of the breadcrumbs have to be taken into account in the size calculations. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Take padding and margin of the creatable actions div into accountDaniel Calviño Sánchez2018-03-011-1/+1
| | | | | | | | | | | | | | | There are some differences in width handling between the browsers used to run the tests, most likely due to their support (or lack of) of certain CSS features: PhantomJS requires "width" to be set (probably because it does not handle flex displays and treats it like a block, so "min-width" does not matter in this case), while Firefox requires "min-width" to be set (otherwise the children of "#controls" could be compressed due to its use of flex display and the elements would end with a different width than the one needed for the tests). Due to all that the width of the breadcrumb siblings must be specified in the tests using both "width" and "min-width". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Replace attribute with local variableDaniel Calviño Sánchez2018-03-011-3/+3
| | | | | | | | The "usedWidth" attribute was not used elsewhere outside the "_resize" method, so it was replaced with a local variable. Moreover, it was also renamed to a more suitable name ("availableWidth"). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Set the width of the parent element in breadcrumb testsDaniel Calviño Sánchez2018-03-011-19/+1
| | | | | | | | | Setting the width of the parent element of the breadcrumbs and then explicitly calling "_resize" is enough to test the resizing behaviour. This makes possible to remove the "setMaxWidth" method and its related code, which was used only for testing purposes. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fixed breadcrumbs calculation and actions flowJohn Molakvoæ (skjnldsv)2017-12-201-1/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix menu declaration and width calculationJohn Molakvoæ (skjnldsv)2017-11-101-4/+6
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Removed console logJohn Molakvoæ (skjnldsv)2017-11-091-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fixed tests and width calculationJohn Molakvoæ (skjnldsv)2017-11-081-2/+3
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Scrutinizer fixJohn Molakvoæ (skjnldsv)2017-11-081-7/+7
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Improve drag & drop and fix some background issue if d&d on narrow windowsJohn Molakvoæ (skjnldsv)2017-11-081-8/+2
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Menu hidden by defaultJohn Molakvoæ (skjnldsv)2017-11-081-3/+3
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fixed some more test and loop fixJohn Molakvoæ (skjnldsv)2017-11-081-11/+15
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Add droppable ability to menu and icon switch. Fix colourJohn Molakvoæ (skjnldsv)2017-11-081-1/+8
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Updated tests according to new systemJohn Molakvoæ (skjnldsv)2017-11-081-5/+36
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix to-be-shown algorithmJohn Molakvoæ (skjnldsv)2017-11-081-2/+3
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Popover iconJohn Molakvoæ (skjnldsv)2017-11-081-2/+2
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fixed click in menuJohn Molakvoæ (skjnldsv)2017-11-081-1/+5
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fixed breadcrumb action feedback and optimisationJohn Molakvoæ (skjnldsv)2017-11-081-7/+7
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Do not hide rootJohn Molakvoæ (skjnldsv)2017-11-081-1/+2
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Popover filling system updatedJohn Molakvoæ (skjnldsv)2017-11-081-47/+65
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Popover initJohn Molakvoæ (skjnldsv)2017-11-081-7/+48
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fixed computation and removed unwanted scriptsJohn Molakvoæ (skjnldsv)2017-11-081-52/+39
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Flex to controlsJohn Molakvoæ2017-11-081-2/+3
| | | | Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
* Breadcrumbs hiding calculationJohn Molakvoæ2017-11-081-55/+25
| | | | Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
* Replace deprecated $.tipsy(...) by $.tooltip(...)Christoph Wurst2017-02-271-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* show whether the current folder was shared or notChristoph Wurst2016-11-071-0/+23
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visual cue when moving draggable item over droppable item,Pellaeon Lin2016-05-211-1/+2
| | | | ie. breadcrumb and filenameTd
* Handle case when breadcrumb and filelist item overlapPellaeon Lin2016-03-171-0/+6
| | | | | | | | | | | | | | | and both receive a drop. Build breadcrumb over and out callback in filelist.js and pass them as options to utilize local selectors of filelist Re-enable td elements after drop to bread crumb Fix# drop handler still being called after enable, it seems that waiting for a short time before re-enabling solves the problem * Add explanations for setTimeout re-enable td.filename drop handler
* Parse backslash as directory separator in breadcrumbLukas Reschke2015-01-241-0/+1
| | | | | | This will parse backslashes as directory separators in breadcrumbs. Thus when accessing something like `/index.php/apps/files?dir=foo\foo` the breadcrumb will properly resolve this instead of showing `foo\foo` Fixes https://github.com/owncloud/core/issues/13643
* fix alt text for breadcrumbs home iconJan-Christoph Borchardt2014-12-171-0/+2
|
* Improved Javascript docs for JSDocVincent Petry2014-10-311-6/+22
| | | | | | Added namespaces so that JSDoc can find them. Fixed a few warnings. Improved some comments.
* Adding link to ellipsis and fixing stylingClark Tomlinson2014-09-161-0/+2
|
* Breadcrumb width calculation fixVincent Petry2014-06-271-72/+72
| | | | | | | | | | | | | | Rewrote the breadcrumb calculation to be more readable. Breadcrumb now has a setMaxWidth() method to set the maximum allowed width which is used to fit the breadcrumbs. The breadcrumb width is now based on the container width, passed through setMaxWidth() by the FileList class. Now using fixed widths for the test crumbs to simulate consistent widths across browsers which rendering engines might usually yield different results.
* Fixed many issues, clean upVincent Petry2014-05-151-3/+7
| | | | | | | | | | | | | | | - fixed upload and storage statistics - fixed infinite scroll to use the correct contain for scroll detection - fixed unit test that sometimes fail for rename case - controls are now sticky again - fixed selection overlay to be aligned with the table - fixed "select all" checkbox that had id conflicts - fixed public page - fixed global actions permissions detection - fix when URL contains an invalid view id - viewer mode now hides the sidebar (ex: text editor) - added unit tests for trashbin - clean up storage info in template (most is retrieved via ajax call now)
* Namespacing for FileList, FileActions and trashbin appVincent Petry2014-05-151-1/+1
| | | | | | | | | | | | | | | | | - FileList is now an instantiable class - FileActions is now in namespace - added App class for trashbin app - moved trashbin overrides into classes extending FileList - replaced many static calls with "this." or "self." to make the classes reusable/extendable - new URL parameter "view" to specify which view is shown, for example "files" or "trashbin" - added OC.Util.History utility class in core for handling history - moved URL handling/routing to OCA.Files.App - popstate will correctly update the current view and notify the view of the URL change so it can update the current dir - added JS unitt tests for the trashbin app - fixed public app to work with the new namespaces
* Moved code to replace svg with png to OC.UtilVincent Petry2014-04-041-3/+2
| | | | | | | | | - Moved code that replaces the "svg" extension for the given file to core as OC.Util.replaceSVGIcon. - Added unit test for OC.Util.replaceSVGIcon - Moved "replaceSVG" to OC.Util.replaceSVG and deprecated the global "replaceSVG" function. - Added alias for SVGSupport() as OC.Util.hasSVGSupport() (for now)
* Correctly set svg for crumb dividerVincent Petry2014-04-031-1/+1
|
* Files, trashbin, public apps use ajax/JSON for the file listVincent Petry2014-04-021-0/+242
Files app: - removed file list template, now rendering list from JSON response - FileList.addFile/addDir is now FileList.add() and takes a JS map with all required arguments instead of having a long number of function arguments - added unit tests for many FileList operations - fixed newfile.php, newfolder.php and rename.php to return the file's full JSON on success - removed obsolete/unused undo code - removed download_url / loading options, now using Files.getDownloadUrl() for that - server side now uses Helper::getFileInfo() to prepare file JSON response - previews are now client-side only Breadcrumbs are now JS only: - Added BreadCrumb class to handle breadcrumb rendering and events - Added unit test for BreadCrumb class - Moved all relevant JS functions to the BreadCrumb class Public page now uses ajax to load the file list: - Added Helper class in sharing app to make it easier to authenticate and retrieve the file's real path - Added ajax/list.php to retrieve the file list - Fixed FileActions and FileList to work with the ajax list Core: - Fixed file picker dialog to use the same list format as files app