WPPizza – A Restaurant Plugin for WordPress › Support › Add-Ons › Extensions › Preorder › Support › Previous/Next Month Buttons same class as for Time Buttons
- AuthorPosts
- 30 March, 2021 at 7:56 am #54871
Hello Oli,
I think i found a bug that wasn’t really intended. The Buttons for Previous/Next Month has the same Class as the Buttons for Time Up/Down, the problem now here is, you have code that let’s the Buttons for the Previous/Next Month disappear when there is no other month or i can go back to the previous month. Now everytime i switch Months one of the Buttons for the Time Disappears too because of the same Class. For now i just deleted the Code that let the Buttons disappear. Hope there is an Update for this soon.30 March, 2021 at 12:03 pm #54873first of all: i dont know why you need that extra code if the previous next months are already not appearing if there’s nothing to choose from (unless you found a bug there somewhere , in which case please direct me to the url where i can see this)
other than that, there’s no “bug” here with the classes they are the same as they are both prev/next if you want to target them separately use the parent element classes as selector (i.e xdsoft_monthpicker and xdsoft_timepicker)
30 March, 2021 at 12:12 pm #54874I don’t think i explained it very well, the Button for going up or down the Timespinner have the same Class as the Buttons for changing months. In your Code you have this
/* dont show previous month selector if - min year available is > current selected - current selected year/month is the same as min year/month */ var showPrevMonth = (ts_min['Y'] > ts_now['Y']) || (ts_min['Y'] == ts_now['Y'] && ts_min['n'] == ts_now['n']) ? false : true; if(!showPrevMonth){ $('.'+pluginElmClassName+' .xdsoft_prev').hide(); }else{ $('.'+pluginElmClassName+' .xdsoft_prev').show(); } /* dont show next month selector if - max year available is < current selected - current selected year/month is the same as max year/month */ var showNextMonth = (ts_max['Y'] < ts_now['Y']) || (ts_max['Y'] == ts_now['Y'] && ts_max['n'] == ts_now['n']) ? false : true; if(!showNextMonth){ $('.'+pluginElmClassName+' .xdsoft_next').hide(); }else{ $('.'+pluginElmClassName+' .xdsoft_next').show(); }
the thing here now is, one of the Buttons for the Timespinner automatically disappear too if one button for changing the Month disappears. Thats because of the same Class they share. I don’t really know if this is intended or not, that the buttons for the Time disappear too.
30 March, 2021 at 12:14 pm #54875This Code is from wppizza-preorder/v3/js/scripts.source.js
30 March, 2021 at 12:20 pm #54876ok, now i understand (i thought you were referring to something *you* had added)
i need to look at the plugin anyway so will see what i find on that front too (looking at the js code you posted above it does indeed look like it’s not targeted as it should be, thanks )30 March, 2021 at 12:24 pm #54877You’re welcome!
And sorry for explaning it so horribly im fron germany 😀30 March, 2021 at 12:29 pm #54878>And sorry for explaining it so horribly
nothing to apologise for.
happens often enough that I don’t read things properly either so it evens out no doubt over time….31 March, 2021 at 4:31 pm #54907should be fixed now as of 3.6.4
thanks for letting me know - AuthorPosts
- The topic ‘Previous/Next Month Buttons same class as for Time Buttons’ is closed to new replies.