Skip to content
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

Adding sticky headings #53

Merged
merged 14 commits into from
Dec 8, 2019
Merged

Adding sticky headings #53

merged 14 commits into from
Dec 8, 2019

Conversation

MaathavanJkr
Copy link
Contributor

Adding sticky headings

Adding sticky headings
@jonorthwash
Copy link
Member

Submitted to address #22.

@sushain97
Copy link
Member

I don't think this works as expected:

image

Please also modify your JS to match the existing style.

Made a side menu bar containing topics
@MaathavanJkr
Copy link
Contributor Author

See now, i just made some changes with shuain's feedback on the issue!

@wei2912
Copy link
Member

wei2912 commented Dec 5, 2019

Saw that the indentation changed quite a lot, was this supposed to be the case? You should try to stick to the old code style, unless it's in deep need of refactoring/reformatting.

Otherwise, testing on the page uploaded to GCI seems to show that the sidebar does its intended purpose well, but there's a lot of unutilised space on the right side as a result of the adopted one-column layout.

Also, just a minor thing - could you reduce the width of the sidebar? It seems kinda large.

@sushain97
Copy link
Member

Please post a screenshot of your changes when you'd like us to review, that'll help get feedback a bit quicker. Ditto to @wei2912 's comment about formatting. This diff has a bunch of unrelated things in it. In fact, please don't edit the old code style at all. You can replicate it with Prettier e.g. https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEB5ASgcQEEA5ASQC1CAVU7YzAXkwHIBDABzgCcYBLAVwC2zADQAdKJkwBhQtIASAUQD6AaUUBNRpgAGAEmB4iZSjToBfALRhWYABZwd4yZkUANAAqlcGtZu36hgQkFNS0xFZwAB7svFwAnk4SUu5ePsoAsqQAMtmkAMraAGwADGUlzlJU2F7ShUwA2swANqxQAOb8rO1waKIsMFz8UADW-cwY3bwd41D8XGjc8ePTYPwARqwwEFzj2xDNfQC6AHSCHAAU27FgjAB8mBfAyVKY17xgSLoc3HxClgZ3mBzEkXFIoKxBHAvkDKq8uHB2BAAKpcZpfHR2GAwdhoJAAenx7V4MDsGxOk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AlEFQIA2YKocABBC47AdBKuzB9CCBAAjvIfAIPLiHQSKOSnAB4h4ggQiI4XEHAKwe0OwUgJwcoSAIsFQtgUMHgQNB0LIU4XAEodwSAI2OsHofaAYUgNnL-oMLdF9O0KXoIMESANXAgYlHAOTusJAaEckbGLgcLI6LAPkGejAIQAmA2PEM2EkfhOYEAA

Topics hidden can be seen in bottom now. and further more developments are done.
@MaathavanJkr
Copy link
Contributor Author

Hidden Topics can be seen in bottom now. and further more developments are done. when they become up they get sticky!! i think its perfectly alright check it. i will send a screen shot too

@MaathavanJkr
Copy link
Contributor Author

1
2
Uploading 3.PNG…

@MaathavanJkr
Copy link
Contributor Author

MaathavanJkr commented Dec 6, 2019

This time i didnt change the old style of code too, i inserted my code alone!!.

@MaathavanJkr
Copy link
Contributor Author

3

<script type="text/javascript">
setInterval(function(){
$( ".stopic" ).each(function(index) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adhere to the previous style and remove the spaces within the brackets i.e. change $( ".stopic" ) to $(".stopic").

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also what does stopic mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sticky Topics
shortly stopics

Changed to old coding style removed spaces
@wei2912
Copy link
Member

wei2912 commented Dec 6, 2019

My brief testing showed this:

2019-12-06-222230_scrot

The bottom sticky headings are positioned very low, and I think it'd be better to have them hover such that they touch the bottom of the "frame" (marked out by the scrollbar). This way it becomes more clear that the headings are part of the content. I also suggest adding a translucent black background to the row of the headings so that we are able to see text scrolling behind the headings.

Otherwise, pretty good work so far - just take care of your code style!

EDIT: Did some further testing, there's a point where the bottom headings start to flash.

@MaathavanJkr
Copy link
Contributor Author

11
12
13

@@ -62,6 +87,44 @@ <h1 id="loading" class="m1 center display-none">⌛</h1>
<a class="fixed right-0 bottom-0 mr2 mb2 text-decoration-none h2" id="refresh" href="#">🔄</a>

<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/zepto.js" integrity="sha384-Cp3V2nlfJJ5aA0ctd1PkfNAEMkXM0EGa6RrmEgiv8D6TCaeZJfUFs/PYfR+B5F5H" crossorigin="anonymous"></script>
<script type="text/javascript">
setInterval(function(){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run this code through Prettier. There are many issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

}
else if ($(this).position().top <= h) {
$(this).prev().removeClass('stickyb');
$(this).prev().css('width', '100%')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method .can be chained with the above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! :)

setInterval(function(){
$('#content').height($(window).height() - $('#navbar').height() - $('.stickTopic').height() - 40);
$('.repos').each(function(index) {
var h = $(window).height() - $('.stickTopic').height() - 8;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use var Prettier will also fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it didn't!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier didnt fixed it, but i do, so done! :)

@@ -72,16 +135,13 @@ <h1 id="loading" class="m1 center display-none">⌛</h1>
name: topic,
repoUrl: `https://github.com/${ORGANIZATION}/apertium-${topic}`,
}));

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please undo the deletion of all these new lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This time only one change had made in the old script! so done :)

TOPICS.forEach(({ topic, name, repoUrl }, i) => {
const repoList = $('<ul class="repos list-reset mt0">');

const repoList = $('<ul id="'+ name +'" class="repos list-reset mt0">');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use jQuery's built-in attribute object parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That change isn't necessary.. So Done ;)

@MaathavanJkr
Copy link
Contributor Author

See Now, I just fixed everything i think! :)
https://maathavanjkr.github.io/source-browser.html

@jonorthwash jonorthwash merged commit 0a994f9 into apertium:master Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants