projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Roo/bootstrap/MasonryBrick.js
[roojs1]
/
Roo
/
bootstrap
/
MasonryBrick.js
diff --git
a/Roo/bootstrap/MasonryBrick.js
b/Roo/bootstrap/MasonryBrick.js
index
b1c23d1
..
477bfef
100644
(file)
--- a/
Roo/bootstrap/MasonryBrick.js
+++ b/
Roo/bootstrap/MasonryBrick.js
@@
-90,7
+90,7
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
return this.getSplitAutoCreate();
}
return this.getSplitAutoCreate();
}
- var cls = 'masonry-brick masonry-brick-full';
+ var cls = 'masonry-brick masonry-brick-full
embed-responsive
';
if(this.href.length){
cls += ' masonry-brick-link';
if(this.href.length){
cls += ' masonry-brick-link';
@@
-104,7
+104,7
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
cls += ' mask-inverse';
}
cls += ' mask-inverse';
}
- if(!this.html.length && !this.maskInverse){
+ if(!this.html.length && !this.maskInverse
&& !this.videourl.length
){
cls += ' enable-mask';
}
cls += ' enable-mask';
}
@@
-143,6
+143,10
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
tag: (this.href.length) ? 'a' : 'div',
cls: cls,
cn: [
tag: (this.href.length) ? 'a' : 'div',
cls: cls,
cn: [
+ {
+ tag: 'div',
+ cls: 'masonry-brick-mask'
+ },
{
tag: 'div',
cls: 'masonry-brick-paragraph',
{
tag: 'div',
cls: 'masonry-brick-paragraph',
@@
-155,7
+159,7
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
cfg.href = this.href;
}
cfg.href = this.href;
}
- var cn = cfg.cn[
0
].cn;
+ var cn = cfg.cn[
1
].cn;
if(this.title.length){
cn.push({
if(this.title.length){
cn.push({
@@
-171,9
+175,10
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
cls: 'masonry-brick-text',
html: this.html
});
cls: 'masonry-brick-text',
html: this.html
});
- }
+ }
+
if (!this.title.length && !this.html.length) {
if (!this.title.length && !this.html.length) {
- cfg.cn[
0
].cls += ' hide';
+ cfg.cn[
1
].cls += ' hide';
}
if(this.bgimage.length){
}
if(this.bgimage.length){
@@
-189,20
+194,13
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
// youtube support only?
cfg.cn.push({
tag: 'iframe',
// youtube support only?
cfg.cn.push({
tag: 'iframe',
- cls: 'masonry-brick-image-view',
+ cls: 'masonry-brick-image-view
embed-responsive-item
',
src: vurl,
frameborder : 0,
allowfullscreen : true
});
src: vurl,
frameborder : 0,
allowfullscreen : true
});
-
-
}
}
- cfg.cn.push({
- tag: 'div',
- cls: 'masonry-brick-mask'
- });
-
return cfg;
},
return cfg;
},
@@
-379,18
+377,18
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
e.preventDefault();
e.preventDefault();
- if (this.activ
c
Class != '') {
+ if (this.activ
e
Class != '') {
this.selectBrick();
}
this.selectBrick();
}
- this.fireEvent('click', this);
+ this.fireEvent('click', this
, e
);
},
enter: function(e, el)
{
e.preventDefault();
},
enter: function(e, el)
{
e.preventDefault();
- if(!this.isFitContainer || this.maskInverse){
+ if(!this.isFitContainer || this.maskInverse
|| this.videourl.length
){
return;
}
return;
}
@@
-403,7
+401,7
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
{
e.preventDefault();
{
e.preventDefault();
- if(!this.isFitContainer || this.maskInverse){
+ if(!this.isFitContainer || this.maskInverse
|| this.videourl.length
){
return;
}
return;
}
@@
-473,6
+471,7
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
window.location.href = this.href;
},
window.location.href = this.href;
},
+ //selection on single brick only
selectBrick : function() {
if (!this.parentId) {
selectBrick : function() {
if (!this.parentId) {
@@
-488,17
+487,28
@@
Roo.extend(Roo.bootstrap.MasonryBrick, Roo.bootstrap.Component, {
return;
}
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;
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: {},
});
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 a Masonry Brick
* @param {Roo.bootstrap.MasonryBrick} the masonry brick to add
@@
-506,7
+516,8
@@
Roo.apply(Roo.bootstrap.MasonryBrick, {
register : function(brick)
{
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
},
/**
* fetch a masonry brick based on the masonry brick ID
@@
-514,11
+525,18
@@
Roo.apply(Roo.bootstrap.MasonryBrick, {
* @returns {Roo.bootstrap.MasonryBrick} the masonry brick
*/
* @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;
}
}