Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

ajax request for ordering panels is send on after finished resizing only #302

Closed
wants to merge 4 commits into from

Conversation

dcrystalj
Copy link
Contributor

@dcrystalj
Copy link
Contributor Author

fixed only first issue

  • Ajax requests to store their position is send many times while window resizing, it should be send only at the end

$(window).resize(function (event) {
initializePanels();
});
$(window).resize( $.debounce( 250, initializePanels) );
Copy link
Member

Choose a reason for hiding this comment

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

Looks good. But there is unnecessary space around.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. But be careful. We probably do want that panels are repositioned automatically while window is resizing? Only we should not be doing Ajax requests to store the state until the very end.

@mitar
Copy link
Member

mitar commented Sep 27, 2012

So this is a good idea. To use a library and to simply wrap in such a way. But you should do this only for Ajax requests.

@dcrystalj
Copy link
Contributor Author

Is not as easy as it might looks like.
It's first time for me doing javascript =)

$(window).resize(function (event) {
initializePanels();
initializeEmptyColumnsForPanels();
orderPanelsDefault();
Copy link
Member

Choose a reason for hiding this comment

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

I think you also have to call makeColumnsSortable.

And orderPanelsDefault is not really the correct thing, no? It reorders thing.

@mitar
Copy link
Member

mitar commented Sep 27, 2012

So this is not so easy. :-)

So when you are resizing, you should in fact reorder them properly when window becomes wide enough for another column. And the way you reorder that should be the same as it is stored in the database. So then you have to make an Ajax request. But just when number of columns change.

It seems it does not store anything at the end of the resizing.

So the problem is in fact just that it reads from the server too many times, not just when number of columns change. Sorry for confusion.

@mitar
Copy link
Member

mitar commented Oct 7, 2012

Do you want to work more on this?

@dcrystalj
Copy link
Contributor Author

Not really, don't have time.

@dcrystalj dcrystalj closed this Oct 7, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants