-
Notifications
You must be signed in to change notification settings - Fork 724
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
Switch layout vs show keyset #502
Comments
I haven't done any performance testing, but switching keysets is going to be faster since the HTML is already present in the DOM and only the display setting is modified. When you switch a layout, it needs to build the HTML, if not already built. If the layout has been built, it clones the stored keyboard and makes any necessary additions like adding a preview and adding a hidden element to measure scroll position. Have you encountered an issue where one is much slower than the other? |
Hi @Mottie, again thanks for your quick reply! My expectations were indeed that you handled the switching of keysets in a smarter way than just rebuilding the whole keyboard, but I had no way of confirming as a lot of your JavaScript code looks like a big soup to me haha. I was asking because I need to handle some mobile or simply low-powered devices and wouldn't like wasting precious client's time :p Consider the issue closed :) |
LOL yeah, it is a mess. I plan on rewriting the code soon-ish... |
Oh sorry, it was in no way meant as a negative remark, I'm just to C# and thus a JavaScript noob :p Nonetheless, if you as well think it's a mess and you have the time, it might just be beneficial. The next question will be very off topic, so feel free not answer. You seem quite experienced with JavaScript and JQuery, how do you view TypeScript and its types? Do you plan on using it in your next project? |
I've never used TypeScript, so probably not LOL! Do you think it's worth learning? |
Haha me neither, but for me it's a nice wrapper around Javascript, with the types making programming and debugging more manageable. I truly wouldn't know whether learning it is worth it, but recently there was quite some momentum behind it, so I was very curious about your view on the introduction of types given your experience. |
FYI, in v1.26.8, I added a new parameter to the keyboard.redraw("new_layout"); The var keyboard = $("#keyboard").data("keyboard"); |
Ah very nice, compacter code! |
It's probably a strange question, but performance-wise, what is faster considering a layout of 10 rows and 17 columns, Switching the Layout or Showing a different KeySet? And please do tell me if there's a better way to ask such questions.
The text was updated successfully, but these errors were encountered: