These are chat archives for FreeCodeCamp/HelpFrontEnd

11th
Aug 2018
abraham anak agung
@padunk
Aug 11 2018 00:31
@isemaj_gitlab in your editor component? why you have state there? Your Editor component don't need state, just use the this.props from parent component App and i think it will work
@isemaj_gitlab same as your Preview component. When you passed props to a child component, you don't have to store it in local child state, cause if you do it will refer to your local state not the parents props.
abraham anak agung
@padunk
Aug 11 2018 00:45
@PGFracing i don't quite understand with it, but you can always open the dev console in new window and arrange it with sublime side by side ( i do this when i have 1 monitor) or try vscode.
James Itum
@isemaj_gitlab
Aug 11 2018 01:45
@padunk Thank you. But do I need to bind the method props that I passed from the App.js component which is called in the update() method (i.e. this.update = this.update.bind(this) in Editor.js )?
abraham anak agung
@padunk
Aug 11 2018 06:16
@isemaj_gitlab no you don't need to. You can also omit bind in app.js by using fat arrow functions. i.e update = () => {}
Ahmed Al-Gallad
@A-Gallad
Aug 11 2018 14:48
Hello all
I just have a very small question regarding submitting an event on click and also on pressing the enter button
I know what I should be writing, I am just confused where should I place it
if anyone is free to help please tell me..Thank you
Rogério Dalot
@Dalot
Aug 11 2018 15:02
Hello @A-Gallad what do you need
Ahmed Al-Gallad
@A-Gallad
Aug 11 2018 15:02
        $(".submitNum").click(function() {

            var $tr = $(this).closest('tr'); 
            var $remaining = $tr.find(".remaining");
            var $qty = $tr.find(".stockQuantity");
            var $numToSubmit = $tr.find(".customInput");

  //Get current values
  var batchSize = +$remaining.attr("data-maxNumber");
  var currentRemaining = +$remaining.text();
  var currentQty = +$qty.text();
  var currentInputValue = $numToSubmit.val(); 
  var difference = currentRemaining - currentInputValue;

  //Subtract values
  if (currentRemaining == 0 && currentQty == 0) {
      alert('No units in stock');
  } else if(currentInputValue <= 0) {
      alert('Please insert a valid quantity to withdraw');
  }
  else if (difference < 0) {
      currentRemaining = difference + batchSize;
      currentQty = currentQty -1;
  } else if (difference > 0) {
      currentRemaining = difference;
  }  else if (difference == 0) {
      currentRemaining = difference;
  } 

  //Update text
  $remaining.text(currentRemaining);
  $qty.text(currentQty);

  $tr.find(".collapseX").hide(); 
  $tr.find(".inputBtn").show();
  $tr.find('.customInput').val('');

});
this is the on click function
works fine no problem
and I found that
 $('.customInput').keypress(function(e){
            if(e.which == 13){//Enter key pressed
            $('.submitNum').click();//Trigger search button click event
        }
    });
Rogério Dalot
@Dalot
Aug 11 2018 15:03
So what is the problem
Ahmed Al-Gallad
@A-Gallad
Aug 11 2018 15:04
I just need to make the on click function work when I press enter aswell
and I am a bit confused where should that line of code be placed ...as when I place it in the doc. ready or outside the function I get an error
Rogério Dalot
@Dalot
Aug 11 2018 15:07
The first step might be wrapping all the code you have below the first evenf into a function
Somewhere outside
Then pass the function the event
But now if you need the event to fire on clicking enter as well
You need to add another event to capture the "keydown" of enter button
Google it, I am on my phone
And that should suffice for you to find your answer
Ahmed Al-Gallad
@A-Gallad
Aug 11 2018 15:11
Okii will do, Thanks alot :)
Prakash Kumar
@ThePrakashKumar
Aug 11 2018 16:32
Any Basic Data Structure YouTube playlist?
Ashan Mohammed
@AshanMohammed
Aug 11 2018 16:40
HELP!
Why does the nav in the left cuts down some of the nav elements without showing them with scrolling
https://codepen.io/ashan_zeroxster/full/EpeQzx/
glitz20
@glitz20
Aug 11 2018 16:50
hey guys if I have 2 component to mount should I create 2 componentDidMount() function or just put comma and mount both in a function? (for react)
DerMann97
@DerMann97
Aug 11 2018 16:51
Hey guys ! What's the exact difference between eclipse and Intellij idea ?
Ahmed Al-Gallad
@A-Gallad
Aug 11 2018 16:57
@AshanMohammed I guess if you remove
 .docnav ul{
    height:100vh;

  }
in the media query
cause you're setting the min-width of screen size but you're not setting the max width
that should make it work
Rogério Dalot
@Dalot
Aug 11 2018 17:16
,
Rob
@PGFracing
Aug 11 2018 17:29
Not sure why my links aren’t yellow on mobile? www.pgfracing.con/second coming.html
newmoon
@newmoon
Aug 11 2018 17:35
@AshanMohammed Use debug mode instead of full mode (change view -> debug) and it will work fine. I think it's a codepen/iframe-related issue.
Lia-Sue-Kim
@Lia-Sue-Kim
Aug 11 2018 19:29
fcc's courses became harder than it was before
yeah now it is more organised but
understanding even a simple thing became harder
for example if you learn var in css from youtube or w3 itself it's much easier
why am i telling it? cuz fcc has a lot of groups which you can get help but still understanding cirricula itself is a long way
i mean he could make it simplier than that
like for example teaching with simple methods and in the middle giving a quiz or something or mini project
and at the end of a langauge he could put a project
Lia-Sue-Kim
@Lia-Sue-Kim
Aug 11 2018 19:34
I'm not againts reading of course but it's ok if it only was reading which makes tired and takes a lot of time
Christopher McCormack
@cmccormack
Aug 11 2018 19:35
@Lia-Sue-Kim who is he?
Lia-Sue-Kim
@Lia-Sue-Kim
Aug 11 2018 19:35
in the other side after reading long explanation and you have to look at those long
The creator of FCC
Quincy Larson
long codes which makes a simple thing tiring to understand
Christopher McCormack
@cmccormack
Aug 11 2018 19:36
FreeCodeCamp is a community - you can collaborate and update anything you think isn't descriptive enough
Lia-Sue-Kim
@Lia-Sue-Kim
Aug 11 2018 19:36
i agree with explanation
but teaching a simple thing like var
you don't have to understand how to make a penguin
which i think again it's cool
but it could be at the end of the curse like mini project
I thought Quincy is here
I know he won't change it but he could think of it in the future
Christopher McCormack
@cmccormack
Aug 11 2018 19:42
@Lia-Sue-Kim I would disagree and say if you read the explanations closely they describe the concepts pretty well. They may be terse at times, but many people like to jump forward without reading closely, while reading closely is really the best way to learn any new material
And again, if you have ideas please feel free to submit issues or even submit a pull request with updates you think would help, it's a community driven project and I'm sure they would appreciate improvements
Lia-Sue-Kim
@Lia-Sue-Kim
Aug 11 2018 19:45
@cmccormack ok I will
Christopher McCormack
@cmccormack
Aug 11 2018 19:45
great :)
Lia-Sue-Kim
@Lia-Sue-Kim
Aug 11 2018 19:47
In addition to above
I know that we live in a time that people want to get something in few seconds but im not one of those.I learn the same thing from many sources and im patient enough