Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:06
    chamsou123 starred canjs/canjs
  • Jan 25 20:18

    greenkeeper[bot] on @octokit

    (compare)

  • Jan 25 20:16

    greenkeeper[bot] on @octokit

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

  • Jan 24 23:05
    greenkeeper[bot] commented #5422
  • Jan 24 23:05

    greenkeeper[bot] on @feathersjs

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

  • Jan 24 23:05
    greenkeeper[bot] commented #5401
  • Jan 24 23:05

    greenkeeper[bot] on @feathersjs

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

  • Jan 24 22:58

    greenkeeper[bot] on @octokit

    (compare)

  • Jan 24 22:57

    greenkeeper[bot] on @octokit

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

  • Jan 24 20:42
    bitsnaps starred canjs/canjs
  • Jan 24 10:50
    chasenlehara opened #5462
  • Jan 24 10:48

    chasenlehara on chasenlehara-patch-1

    Upgrade to can-queues@1.3.2 (compare)

  • Jan 24 10:41

    chasenlehara on can-simple-dom-1.7.1

    (compare)

  • Jan 24 10:41
    chasenlehara closed #5458
  • Jan 24 10:40

    chasenlehara on can-stache-bindings-5.0.4

    (compare)

  • Jan 24 10:40
    chasenlehara closed #5455
  • Jan 24 10:40

    chasenlehara on can-stache-5.1.0

    (compare)

  • Jan 24 10:40
    chasenlehara closed #5453
  • Jan 24 10:40

    chasenlehara on can-map-4.3.12

    (compare)

  • Jan 24 10:40
    chasenlehara closed #5452
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
tried with and without
Chris Gomez
@akagomez
Can you paste your helper?
Gerard Finnerty
@halcyonandon
can.stache.registerHelper('isTruncated', function(string, limit) {
return string().length > limit;
});
string() alone is temporary till i do a check if the value being passed is a function
do I need to do something with options.fn or options.inverse? The documents don't state if this is required
Chris Gomez
@akagomez
@halcyonandon Yes. You need to return 1) options.fn(), 2)options.inverse(), or 3) a String.
Gerard Finnerty
@halcyonandon
ohhhhhh, ok... trying that, thanks @akagomez
Chris Gomez
@akagomez
Not a problem.
Gerard Finnerty
@halcyonandon
yeah that worked, thanks again
opolyo01
@opolyo01
Wow, looks like I found a bug in can.Component. The scope changes are not getting fired for certain Objects
self.attr( 'queryResult', response );
//Redraw chart if type changes or new data is available
'{scope} queryResult': function( Scope, ev, newVal ) {
debugger;
if(!newVal.isEmpty) {
this.drawChart();
}
},
queryResult function is only getting called when I pass certain type of data to it
It goes back to mine circular dependency issue that I mentioned yesterday.. the object with complex nesting is not getting called, while simple responses do
Chris Gomez
@akagomez
@opolyo01 Can you copy your component into a gist for one of us to look at?
opolyo01
@opolyo01
James is helping me now
Chris Gomez
@akagomez
Oh wow! I didn’t know you could PM in Gitter.