Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:24

    greenkeeper[bot] on @octokit

    (compare)

  • 04:23

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

  • Jan 28 17:46

    greenkeeper[bot] on @octokit

    (compare)

  • Jan 28 17:44

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

  • Jan 28 16:41
    cherifGsoul edited #5465
  • Jan 28 16:40
    cherifGsoul labeled #5465
  • Jan 28 16:40
    cherifGsoul opened #5465
  • Jan 27 21:03
    justinbmeyer commented #5464
  • Jan 27 20:33
    bmomberger-bitovi opened #5464
  • Jan 27 19:13

    greenkeeper[bot] on @octokit

    (compare)

  • Jan 27 19:12

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

  • Jan 27 14:09
    rjgotten edited #5463
  • Jan 27 13:57
    rjgotten edited #5463
  • Jan 27 13:48
    rjgotten edited #5463
  • Jan 27 13:45
    rjgotten edited #5463
  • Jan 27 12:20
    rjgotten edited #5463
  • Jan 27 09:42
    rjgotten edited #5463
  • Jan 27 09:04
    rjgotten opened #5463
  • Jan 26 16:06
    chamsou123 starred canjs/canjs
  • Jan 25 20:18

    greenkeeper[bot] on @octokit

    (compare)

opolyo01
@opolyo01
$.extend(true, {}, this.constructor.defaults, overrides)
jquery.js:300 Uncaught RangeError: Maximum call stack size exceeded
at Function.jQuery.extend.type (http://localhost:8126/bower_components/jquery/dist/jquery.js:300:16)
Has anyone ever had this issue? I simply extending two objects.. overrides has a property of clientState that is pretty big in size for some states
David Luecke
@daffl
@opolyo01 Could it be that you have a circular reference in your object tree? jQuery's deepExtend might not be able to deal with that.
Chris Gomez
@akagomez
@alexisabril Does serialize: false not handle that case? Or am I misunderstanding the problem?
opolyo01
@opolyo01
@daffl Yeah, it is. If I try to do JSON.stringify on it, it throws circular reference error. How do you deal with such issues? I am thinking to simply delete properties that cause circular reference, and update the code that relies on them.
avg6003
@avg6003
This message was deleted
This message was deleted
avg6003
@avg6003
can anyone tell me how to give fade effect on loading template? Here is my code:
'define(['can','jquery','jqueryui'], function(can,$) {
var PopUpController = can.Control.extend({
defaults: {
view: 'views/signup.hbs'
}
}, {
init: function(element, options) {
$('#popup').fadeIn('slow',function(element){
element.html(can.view(options.view, {}));
});
$('.content').click(function(){
$('#popup').fadeOut('slow');
})
},
})
return PopUpController;
})`
fadeOut is working but fadeIn isn't
I am new here sorry if there is some typo or formatiing!!
Nikolay Nadorichev
@Luanre
@DipeshRaichana you've inserted can.Control after fadeIn so jQuery can't animate unexisting DOM element
Alexis Abril
@alexisabril
@akagomez It definitely does and you would need to do that whether the property is on the map itself or on some inheriting map. However, if you have a large model with a lot of properties that are specific to a component’s view, those properties don’t need to be on the model itself. If that model is used in another component, with it’s own set of view related properties(isChecked, isHighlighted, isEditing, etc), the model itself gets polluted with arbitrary data.
Chris Gomez
@akagomez
@alexisabril I totally get you now. But I’m confused why those properties wouldn’t be on the ViewModel.
Instead of the Model.
Alexis Abril
@alexisabril

they would be on a viewmodel, just not the component’s necessarily. imagine you have a user model and your component has a user.list. user.isSelected could be some property you want to set.

In your view, you’d probably have something like:

{{#each users}}
<input type=“checkbox” can-value=“{isSelected}”/>
{{/each}}

isSelected would be convenient at some lower level than the component viewmodel itself, but not necessarily all the way down to the model.

Chris Gomez
@akagomez
I see. Just for fun, I think the way I’d handle that is to have a list of user models (users), and a list of selected users (selectedUsers). isSelected would be a helper that checks for the current user in the selectedUsers list.
Matthew Phillips
@matthewp
@alexisabril I think you want a component for each user in this case
Chris Gomez
@akagomez
Ah! +1 @matthewp
Matthew Phillips
@matthewp
or you could (this might be what you said) have a viewmodel that extends User
I remember us having this issue with sams
@Alfredo-Delgado i don't remember how we resolved that
probably with sub-components
Alexis Abril
@alexisabril
@matthewp yep, that was my thought as well
a vm that extends user
a component for each user would accomplish the same goal in this scenario
I think a vm that extends user would be the elegant solution, provided we have an inheritable define plugin
Chris Gomez
@akagomez
@alexisabril I’m fairly certain define properties are inheritable.
Matthew Phillips
@matthewp
not nicely
Chris Gomez
@akagomez
No?
Matthew Phillips
@matthewp
you have to combine them manually in init IIRC
this.define = can.extend(this.define, parent.define)
Nikolay Nadorichev
@Luanre
in my project I've solved this issue with parseModels and setting model property for local scope
Alexis Abril
@alexisabril
wow, @akagomez I think you’re right
it looks like it was included into the compute feature you wrote
@matthewp yeah, that’s the way I remember it too
Chris Gomez
@akagomez
@alexisabril Huh. Right on.
Gerard Finnerty
@halcyonandon
I'm trying to use a helper as a conditional, but it just displays 'true' and doesn't render the content inside. I followed this guide http://canjs.com/docs/can.mustache.helpers.sectionHelper.html but it doesn't allow it without a # and there's a mismatch in the closing in that doc... is this ready to use?
{{#isTruncated account.name 15}} stuff {{/isTruncated}} ...this helper returns true if the string is greater than 15 and renders only 'true' and not 'stuff'
Chris Gomez
@akagomez
@halcyonandon if (condition) { return options.fn() } else { return options.inverse() }
Gerard Finnerty
@halcyonandon
@akagomez I wouldn't do multiple return statements, but the helper itself works, it just doesn't work in mustache as a template condition
Chris Gomez
@akagomez
The helper will output what you return. If you return true it will render “true”.
Gerard Finnerty
@halcyonandon
Not based on the docs.... I want to use a helper to render a block... i do not want to just render what the helper returns... see http://canjs.com/docs/can.mustache.helpers.sectionHelper.html

Calls a mustache helper function with a block, and optional inverse block.

{{#helper [args...] [hashName=hashValue...]}}BLOCK{{/helper}}
Calls a mustache helper function or a function with a block to render.

The template:

<p>{{countTo number}}{{num}}{{/countTo}}</p>

this does not work for me
I'm trying in 2.2.5, upgrading to 2.2.6, but the release notes don't mention this feature for 2.2.6
Chris Gomez
@akagomez
@halcyonandon bitovi/canjs#1535
Gerard Finnerty
@halcyonandon
I use the hash still with no luck