-
Notifications
You must be signed in to change notification settings - Fork 19
ajax request for ordering panels is send on after finished resizing only #302
Conversation
fixed only first issue
|
$(window).resize(function (event) { | ||
initializePanels(); | ||
}); | ||
$(window).resize( $.debounce( 250, initializePanels) ); |
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.
Looks good. But there is unnecessary space around.
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.
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.
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. |
Is not as easy as it might looks like. |
$(window).resize(function (event) { | ||
initializePanels(); | ||
initializeEmptyColumnsForPanels(); | ||
orderPanelsDefault(); |
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.
I think you also have to call makeColumnsSortable
.
And orderPanelsDefault
is not really the correct thing, no? It reorders thing.
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. |
Do you want to work more on this? |
Not really, don't have time. |
#284