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

Allow ordering of drawer items #1393

Closed
brian-learningpool opened this issue Jan 24, 2017 · 10 comments
Closed

Allow ordering of drawer items #1393

brian-learningpool opened this issue Jan 24, 2017 · 10 comments

Comments

@brian-learningpool
Copy link
Member

It would be very useful to have control over the positioning of items which appear in the drawer.

@moloko
Copy link
Contributor

moloko commented Jan 30, 2017

also see #534

@ratnadeeprajput ratnadeeprajput self-assigned this Apr 3, 2017
@barryo-learningpool
Copy link
Contributor

Hi @ratnadeeprajput , Are you currently working on this? If not, do you mind if I give it a go?

@ratnadeeprajput ratnadeeprajput removed their assignment Jul 21, 2017
@ratnadeeprajput
Copy link

@barryo-learningpool - sure, please proceed.

@barryo-learningpool
Copy link
Contributor

Hi guys, I need some pointers on how to go about this. Is it safe to assume that only "Extensions" will ever populate the drawer? If not, do we need a hasDrawer flag on plugins?

And then does it seem like a good idea to have a sortOrder property on plugins/extensions or should we keep this separate somewhere?

@moloko
Copy link
Contributor

moloko commented Jul 21, 2017

Is it safe to assume that only "Extensions" will ever populate the drawer?

Yes I think so.. I certainly can't think of an example of anything other than an extension putting content into the drawer.

And then does it seem like a good idea to have a sortOrder property on plugins/extensions or should we keep this separate somewhere?

I think the extension developer should be responsible for declaring this property and exposing it to the course author. But we should recommend a name and location for this, _drawerOrder would be good and since most extensions that list themselves in the Drawer have an entry in course.json, that would be the recommended place to put that property, alongside the _isEnabled property, ideally.

What I would then do is add an order argument to drawer.addItem that extensions could then pass their order property to - or not.

In the event that two extensions have the same drawerOrder set I would suggest a 'you snooze you lose' policy in which the first one to register get the desired position and the runner-up gets added after it.

Extensions that don't pass drawerOrder argument to drawer.addItem should just be added to the end of the collection.

barryo-learningpool added a commit to barryo-learningpool/adapt_framework that referenced this issue Jul 24, 2017
@barryo-learningpool
Copy link
Contributor

@moloko Thanks for the pointers, much appreciated.

It seems ordering the collection by the drawerOrder attribute works quite nicely.

See my change and comments here:
#1685

@oliverfoster
Copy link
Member

I like this. We also need a left, right, center + order for the navigation bar.

@barryo-learningpool
Copy link
Contributor

Cheers @oliverfoster. Is that covered in #1555 ?

barryo-learningpool added a commit to barryo-learningpool/adapt_framework that referenced this issue Jul 24, 2017
@oliverfoster
Copy link
Member

Yup, I just figure, whilst your brain is fresh on the subject you might like to tackle it?

moloko added a commit that referenced this issue Aug 2, 2017
@moloko
Copy link
Contributor

moloko commented Apr 16, 2018

this is now resolved in core, resources and glossary

Kineo have updated their search extension and a message was posted in the community forums asking people who maintain extensions that use to drawer to update their extension to support _drawerOrder

don't think there's anything more to do here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants