@萝莉w Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
this is basically the situation, and I want the item-head nodes to have equal height
I tried getting all elements, then pick the max height and then loop over them to apply that height to all of them, but that stops them from being responsive
their height wont increase if I make the screen smaller so that the content will still fit inside it
pretty much every css solution I found is only for direct neighbours, not for their children
@Leite Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
anyone with experience doing virtual scrolling on a table willing to share some tips? working on a vuejs project with vuetify and now trying to implement virtual scrolling in a vuetify table
@Neil virtual scrolling, a table with many rows, but visible and rendered in the dom rows are just enough to fill the view and a small buffer above and below, when you scroll, new elements are added as needed and the ones not visible removed
@Leite hmm, I suppose you'd simply have to determine what your buffer size is, and if you scroll past the point where the remaining rows is less than the buffer size, you make an ajax call
you should probably just be careful to not make multiple requests to the server
@Wietlol you'd make it row-based and not column based
that's all
it just wouldn't look like a single table but several separate columns
yeah, that's the approach i took, requesting more items as needed, but it started getting slow the more rows got added to the table
so the proposed solution is something like this angular-yni1jw.stackblitz.io, if you inspect the list, although there's 10k records, only a few are in the dom at any moment
I've got two different pages that share a lot of javascript functions, but also have a lot of javascript functions exclusive to that page. All functions need the freedom to call each other, and I'd like to edit the shared functions in one place. I've been googling for ages and cannot find a style guide for the best way to do this. Anyone got a link?
I was tempted to post it as a question, but style related questions don't seem to be well received by the community
@Neil yeah, trying to do something smart to handle that, i'm using Vuejs and Vuetify, and any npm library that does that virtual-scroll thingy wasn't playing nice with vuetify
A bit more context, I have a function that tells you the postage price of your item. I want each page to calculate it independently, but I only want to write the calculation once
I have way more functions to share than that, but that's just one of them
Exactly, and so far I've done it in a very very ugly inelegant way that technically works
By the way, you'll have to forgive me. I'm self taught, so there is likely some first year basics I don't know while some master level expert things I do. Not familiar with the term "build step"
I'm trying to install github private repository by npm that includes other private github repositories as dependency.
Have tried a lot of ways and posts but none is working. Here is what i'm doing :
npm install git+https://github.com/myusername/mygitrepository.git
in package.json is like :
...
finally the scroll of truth! "There is no 'best' language, only languages programmers feel comfortable using and languages they're unfamiliar with." Bleh!
So, what are the PHP quirks that most languages lack?
I've heard the spectrum from machine level to interpretive, but I've never heard where PHP sits on that spectrum. I tend to romanticize machine level languages a bit.
php lets you define methods with the same name in the global scope
the one which gets called is the last one declared
or at least it used to be this way, it may have changed
as far as languages go, this is far from ideal
a method like "indexOf" you may call thinking it behaves in a certain way, but in reality it was overridden by a slightly different method by the same name
also allowing variables in global scope in general is a bad idea
I think you can also override global scope variable definition in the same way
@JonathonPhilipChambers on the initial topic of having a build step for your application, you could have a look at parceljs, it's possibly the easiest to get started with parceljs.org
I'll never be put off a language just because it lets me do something useless. I just think "wow, this language is so powerful, it can do useless things in addition to the useful things!"
And yes, I am fully aware how stupid that logic is, but it brings me joy so I'm keeping it
I see both sides. Using the tools from a professional perspective, I agree. But I'm writing just one website for my business, and how I feel while coding is more important than how fast I get it done.
In C++, there were a lot of weird rules like what happens if you don't use brackets in the if clause and the next statement is an if..else.. does that else belong to the inner if or the outer if?
and you could indent it however way you wished and thought it worked in one way and it worked in a completely different way
The thing I liked about C++, is how fast the final thing would run. It may take ages to compile, but once compiled I had fine control over removing unnecessary CPU cycles
Keep in mind, I'm not speaking from experience. I never wrote anything worth running fast.
Yeah, I don't mind a language where I need to write twice as much, provided I can save one CPU cycle in doing so. I have no logical reason for this preference. It's purely a fun thing.
i'm trying to figure out if i can 'hook' into the core react renderer to add a border to each component i am rendering to the page.
does anyone know if this is possible? I assume there's a core react 'painter' somewhere that calls all available components then calls their render function. So all i'm thinking is i do a <div with border class>{component.render()}</div>
I didnt even bother using Greater than or equal to or the other calculations...
I just did a check if it hit the wall
So, it does still hit the wall and freeze, but only if its at 0 velocity, so its functioning correctly... I should probably also reverse apply this so it doesnt get stuck in the top right corner
Minor note, you may want to move the ball back by more than its radius
Instead, you might want to look at how far the ball made it into the wall, and move it back by negative that much, which helps the animation remain consistent across frame rates
If your ball is moving 10 pixels per redraw, it might make it 5 pixels into a wall. If you bump it back until it's no longer inside the wall, you've altered the velocity of the ball slightly so that it only gets to move 5 pixels that redraw. If instead, you bounce it back 5 pixels away from the wall, then the ball has continued to move 10 pixels per redraw.
Is something like this possible to Use main function to check whether condition is true and then run the callback that was sent to this function?
I want to create a reusable function for confirming, deleting where i just pass the object with arguments and then a callback what happens after the user accepts.
Here's the jsfiddle https://jsfiddle.net/43zrqkvm/2/
It's hard to explain tho, i'll put my actual code in there ina sex
sec*
Here's the new updated version https://jsfiddle.net/43zrqkvm/3/
There's even a header preventing your page from rendering in an iframe and it's used for security so I presume there's no known way to bypass that in normal browsers
Hi guys. I need to build a lib, which could be the same time used from node.js and imported via require and consumable from the frontend via es6 modules import. the lib itself is a rust compiled to wasm Could you give me some hints - how could I try to achieve this?
actually I did solve rust/wasm part with 2 separate builds
what I currently thinking of is how to build a kind of adapter for this 2 build which hide implmentation