JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Sep 1, 2020 17:35
Hi, looking for help with this Jest question stackoverflow.com/questions/63683323/…
Jul 1, 2020 08:13
0
Q: Dropdown calculate scrolltop

BatmanI'm trying to have a dropdown component scroll when I use the down key. I'm having issues getting the measurements correctly so that the selected item is at the bottom of the container box. Right now it's oddly positioned. Gif example Code: const handleScrolling = () => { // I pass in a ref...

Jul 1, 2020 08:13
Really need some help with this
Jun 5, 2019 05:28
If anyone has any ideas that would be great

https://stackoverflow.com/questions/56439035/node-cannot-find-module-that-exist-when-using-typescript?noredirect=1#comment99472415_56439035
Oct 26, 2017 04:28
If possible I'd rather just replace the entire line
Oct 26, 2017 04:28
then I'd have to do a lot of clean up to remove everything after too
Oct 26, 2017 04:28
I end up losing the 2nd argument this way
Oct 26, 2017 04:28
Oct 26, 2017 04:24
I'm really not understanding what you mean unfortunately.
Oct 26, 2017 04:20
That won't work, I'm trying to replace the whole expression to this CheckDB(sqlReader, "$1", "$2")
Oct 26, 2017 04:16
they all look like this If(IsDBNull(sqlReader.Item("someText")), 0, sqlReader.Item("someText"))
Oct 26, 2017 04:15
dont think so
Oct 26, 2017 04:10
I was trying to follow this stackoverflow.com/questions/46795595/…
Oct 26, 2017 04:05
Looking for some help with Regex, I'm trying to do a find replace with this string:

IIf(IsDBNull(sqlReader.Item("someText")), 0, sqlReader.Item("someText"))

I tried: If\(IsDBNull\(sqlReader\.Item\("(.+?)"\)\), "(.+?)", sqlReader\.Item\("(.+?)"\)\)

But I'm not getting matches
Apr 7, 2017 15:56
I'm using lodash on my site, they have an equivalent. I'll figure it out, thanks for your help.
Apr 7, 2017 15:54
lol fuck, no IE support :P
Apr 7, 2017 15:54
@ssube Ah okay, thanks for the clear explanation. For this situation I don't need deep merging but I did have another file that was overwriting my object when I just wanted to add more properties, so this helps. Thank you.
Apr 7, 2017 15:51
@ssube what do you mean it won't deep merge?
Apr 7, 2017 15:49
Hi, I noticed that when I have an existing global object. If I do something like var global = {"addition properties and methods"}, everything that was in global before gets removed and only the additional stuff gets set. Is the dot notation the only way to extend an existing object?
Oct 25, 2016 06:10
Got it working, thanks for the help
Oct 25, 2016 06:08
Okay that helps
Oct 25, 2016 06:08
@monkeyinsight I see what's happening, I'm sending in the result of objStorageA (which is just an array) to the function. I'm not actually sending in the reference
Oct 25, 2016 06:05
I'll give it a shot
Oct 25, 2016 06:05
this.obj.storage?
Oct 25, 2016 06:05
@monkeyinsight if I'm sending the argument as obj.storageA wouldn't this already be referencing obj?
Oct 25, 2016 06:04
@monkeyinsight result is just json data coming from a rest call
Oct 25, 2016 06:02
Hey, I have an object that holds two arrays and has a method. I'm trying to figure out how to pass as an argument where I want the method to store the results within my object for example: let obj = {storageA: [], storageB: [], saveFunc: function(storage) {storage = results}} so when I call obj.saveFunc(obj.storageA) the result of saveFunc are saved within the object where I specify. Right now I'm just getting null
Sep 4, 2016 01:51
0
Q: Determining the last file chunk

BatmanI'm trying to setup a file upload through rest for large files. The function below is taking care of chunking but I need to be able to recognize the last chunk because my rest call changes to /finishUpload() in order to commit the save. Right now I'm only able to figure out when the blob is emp...

Aug 17, 2016 03:11
0
Q: How do I load my scripts into webpack

BatmanI've used webpack to bundle my npm dependencies in the past, like jquery, lodash, etc. I'm having trouble figuring out how to bundle dependencies AND my own scripts? Loader.js: require('expose?$!expose?jQuery!jquery'); require('lodash'); require('react'); require('slider-component.js'); // f...

Jul 15, 2016 02:47
@William Thanks, I'll give it a shot
Jul 15, 2016 01:46
Hi, I'm looking for a simple to use templating library that will allow me to do something like ng-repeat. Any recommendations
Jan 14, 2016 22:43
0
Q: How to let the controller know when Factory is ready

BatmanI have this init function for one of my controllers: init: function() { console.info("SETTINGS MODULE INITIATED"); $timeout(function(){ Settings.config = AuthService.getSettings(); Settings.hasAccess = AuthService.getAccessStatus(); Settings.licensed = AuthSe...

Dec 22, 2015 00:49
Is it possible to minify or ugly them to reduce the size at all?
Dec 22, 2015 00:44
I have a source map close to 10MB
Dec 22, 2015 00:44
Does the size of your source map matter?
Nov 5, 2015 19:52
0
Q: Google Maps returning a grey box

BatmanI works fine when there's only 1 result but when I have more than 1 marker, it just returns a grey box with no errors in the console making it quite challenging to track down. function getUserLocation() { var browserSupportFlag = false; // Try W3C Geolocation (Preferred) if(navigator.geol...

 

Ruby :: Sometimes on Rails

The humane programming language. Be nice. Have fun. Lurkers...
Nov 10, 2015 00:23
Sorry, looking for help on this please

http://stackoverflow.com/questions/33617177/referencing-self-and-through-association-in-scopes
Nov 10, 2015 00:18
How are you ensuring that self.venue.notice_time.hours is not nil? — max 1 hour ago
Nov 2, 2015 20:41
Hey, I'm trying to update associations for all my records but I'm getting

NoMethodError: undefined method `<<' for #<Venue:0x0000000b8ca310>
from /var/lib/gems/2.2.0/gems/activemodel-4.2.4/lib/active_model/attribute_methods.rb:433:in `method_missing'


This is how I tried to do it:

Venue.find_each(batch_size: 10) do |venue|
venue << Amenity.limit(rand (2..4)).order("RANDOM()")
end
Oct 27, 2015 21:03
0
Q: Trying to filter datetime fields based on time only

BatmanI'm having some trouble figuring out how to build a scope for a specific type of query I'm trying to do. Basically I have an Availabilities model which has a start_time and end_time datetime columns. I have a start and end time dropdown in my view which returns this query on search: "availa...

Oct 19, 2015 22:56
0
Q: Manipulating timezones

BatmanI'm having issues with timezones and importing dates from different zones in my application, the zones are for the Availability model. On the UI end of things I have bootstrap datetimepicker and that creates params[start_time] but it doesn't have a specific zone associated with it. The Availab...

Oct 19, 2015 17:22
Ah okay
Oct 19, 2015 17:21
Ive read that I should always save it in UTC however and just convert to user timezone in the views
Oct 19, 2015 17:19
When importing records with datetime, should I always convert from the users timzone to utc before saving?
Oct 15, 2015 18:58
I'm not actually getting results
Oct 15, 2015 18:57
It seems like it's mostly syntax issues
Oct 15, 2015 18:57
Yea you're right
Oct 15, 2015 18:53
@JanDvorak yea that was an awkward typo
Oct 15, 2015 18:52
@HunterStevens so it's not likely I'd be able to have an AND in the scope?
Oct 15, 2015 18:48
Looking for a bit of help on this question please stackoverflow.com/questions/33155699/…