New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Scroll to Line number based on Hash IE http://foo.com/p/bar#L10 will scroll to line 10. #4554
Merged
Merged
Feature: Scroll to Line number based on Hash IE http://foo.com/p/bar#L10 will scroll to line 10. #4554
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ea2c294
working clicking on side div line number to set line number hash and …
JohnMcLear 46805d8
smell resolve
JohnMcLear 1a577d5
smell resolve
JohnMcLear a2a7322
focus caret at line
JohnMcLear 1956b29
jshint and test
JohnMcLear 78fe277
special king clothes
JohnMcLear 7440dd1
docs?
JohnMcLear 114656c
working in both mobile and normal view
JohnMcLear 7fe37cd
linting
JohnMcLear 801f94e
fix up tests
JohnMcLear 4247dc7
Merge branch 'develop' into scroll-to-line
JohnMcLear b85c347
scrollTo test: waitFor -> waitForPromise
webzwo0i 6eb90fc
replace replace with substr for readability
webzwo0i File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict'; | ||
|
||
describe('scrolls to line', function () { | ||
// create a new pad with URL hash set before each test run | ||
beforeEach(function (cb) { | ||
helper.newPad({ | ||
hash: 'L4', | ||
cb, | ||
}); | ||
this.timeout(10000); | ||
}); | ||
|
||
it('Scrolls down to Line 4', async function () { | ||
this.timeout(10000); | ||
const chrome$ = helper.padChrome$; | ||
await helper.waitForPromise(() => { | ||
const topOffset = parseInt(chrome$('iframe').first('iframe') | ||
.contents().find('#outerdocbody').css('top')); | ||
return (topOffset >= 100); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('doesnt break on weird hash input', function () { | ||
// create a new pad with URL hash set before each test run | ||
beforeEach(function (cb) { | ||
helper.newPad({ | ||
hash: '#DEEZ123123NUTS', | ||
cb, | ||
}); | ||
this.timeout(10000); | ||
}); | ||
|
||
it('Does NOT change scroll', async function () { | ||
this.timeout(10000); | ||
const chrome$ = helper.padChrome$; | ||
await helper.waitForPromise(() => { | ||
const topOffset = parseInt(chrome$('iframe').first('iframe') | ||
.contents().find('#outerdocbody').css('top')); | ||
return (!topOffset); // no css top should be set. | ||
}); | ||
}); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above, also applies to here