cls += ' mask-inverse';
}
- if(!this.html.length && !this.maskInverse){
+ if(!this.html.length && !this.maskInverse && !this.videourl.length){
cls += ' enable-mask';
}
tag: (this.href.length) ? 'a' : 'div',
cls: cls,
cn: [
+ {
+ tag: 'div',
+ cls: 'masonry-brick-mask'
+ },
{
tag: 'div',
cls: 'masonry-brick-paragraph',
cfg.href = this.href;
}
- var cn = cfg.cn[0].cn;
+ var cn = cfg.cn[1].cn;
if(this.title.length){
cn.push({
cls: 'masonry-brick-text',
html: this.html
});
- }
+ }
+
if (!this.title.length && !this.html.length) {
- cfg.cn[0].cls += ' hide';
+ cfg.cn[1].cls += ' hide';
}
if(this.bgimage.length){
// youtube support only?
cfg.cn.push({
tag: 'iframe',
- cls: 'masonry-brick-image-view',
+ cls: 'masonry-brick-image-view embed-responsive embed-responsive-16by9',
src: vurl,
frameborder : 0,
allowfullscreen : true
});
-
-
}
- cfg.cn.push({
- tag: 'div',
- cls: 'masonry-brick-mask'
- });
-
return cfg;
},
e.preventDefault();
- if (this.activcClass != '') {
+ if (this.activeClass != '') {
this.selectBrick();
}
- this.fireEvent('click', this);
+ this.fireEvent('click', this, e);
},
enter: function(e, el)
{
e.preventDefault();
- if(!this.isFitContainer || this.maskInverse){
+ if(!this.isFitContainer || this.maskInverse || this.videourl.length){
return;
}
{
e.preventDefault();
- if(!this.isFitContainer || this.maskInverse){
+ if(!this.isFitContainer || this.maskInverse || this.videourl.length){
return;
}
window.location.href = this.href;
},
+ //selection on single brick only
selectBrick : function() {
if (!this.parentId) {
return;
}
+ for(var i = 0; i < m.selectedBrick.length; i++) {
+ var b = Roo.bootstrap.MasonryBrick.get(m.selectedBrick[i]);
+ b.el.removeClass(b.activeClass);
+ }
+
+ m.selectedBrick = [];
+
m.selectedBrick.push(this.id);
this.el.addClass(this.activeClass);
return;
- }
+ },
+ isSelected : function(){
+ return this.el.hasClass(this.activeClass);
+
+ }
});
Roo.apply(Roo.bootstrap.MasonryBrick, {
//groups: {},
- groups = new Roo.util.MixedCollection(false, function(o) { return o.el.id; }),
+ groups : new Roo.util.MixedCollection(false, function(o) { return o.el.id; }),
/**
* register a Masonry Brick
* @param {Roo.bootstrap.MasonryBrick} the masonry brick to add
register : function(brick)
{
- this.groups[brick.id] = brick;
+ //this.groups[brick.id] = brick;
+ this.groups.add(brick.id, brick);
},
/**
* fetch a masonry brick based on the masonry brick ID
* @returns {Roo.bootstrap.MasonryBrick} the masonry brick
*/
- get: function(brick_id) {
- if (typeof(this.groups[brick_id]) == 'undefined') {
- return false;
+ get: function(brick_id)
+ {
+ // if (typeof(this.groups[brick_id]) == 'undefined') {
+ // return false;
+ // }
+ // return this.groups[brick_id] ;
+
+ if(this.groups.key(brick_id)) {
+ return this.groups.key(brick_id);
}
- return this.groups[brick_id] ;
+
+ return false;
}