Commit graph

10 commits

Author SHA1 Message Date
Robert Speicher
fc0d92746d Prevent a JS error in MergeRequestTabs
When `window.location.hash` is pointing to a note, e.g. `#note_1234`,
`scrollToElement` would throw an error because a selector such as
`.commits #note_1234` doesn't exist, so `offset()` returned `undefined`.

This error would prevent subsequent calls from running, which caused the
loading spinner to never be hidden.

Now we ensure the selector returns a valid element before trying to
scroll to it.
2015-10-14 15:01:25 -04:00
Robert Speicher
29fe488b0c Make the loading spinner toggle more explicit
Occasionally the loading spinner would stay visible after the tab
finished loading. This change makes the toggle explicit so that it's
always shown on `beforeSend`, and always hidden on `complete`.

Plus a bonus semi-colon eradication! 💥
2015-10-08 20:53:29 -04:00
Valery Sizov
31330e4a3c Fix anchors to comments in diffs 2015-10-05 14:00:41 +03:00
Stan Hu
ae3f869fd1 Fix the "Reload with full diff" URL button
On the first load, the merge request tabs would be requested in JSON format to render
the HTML. This would cause the "Reload with full diff" button to create a link to diff.json.

Closes #2041
2015-07-23 12:53:54 -07:00
Dmitriy Zaporozhets
9860ab0f22
Remove sticky-diff functionality
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-06 11:34:37 +02:00
Robert Speicher
d2b5c3f6ce Trigger sticky_kit:recalc when diffs are pre-loaded 2015-06-25 21:26:20 -04:00
Robert Speicher
4e7f23fe0b Reorder MergeRequestTabs constructor
The tab was being activated before we set the `[commits|diffs]Loaded`
variable, so even when the `/diffs` route is accessed directly, like
from the "Side-by-side" link, the tab was being loaded from its default
source.

Fixes #1887
2015-06-25 18:33:24 -04:00
Robert Speicher
e17020b907 Add MergeRequestTabs specs 2015-06-21 22:57:32 -04:00
Robert Speicher
8e72c65cda Minor style fixes in MergeRequestTabs 2015-06-21 18:57:04 -04:00
Robert Speicher
ce20400628 Extract MergeRequest tab behavior to its own JS class 2015-06-17 16:59:50 -04:00