Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for Ext css prefix used by namespaced builds #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Extensible.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ Ext.define('Extensible', {
// static style rules rather than recalculate sizes on each resize.
// We check for less than 3 because the Ext scrollbar measurement gets
// slightly padded (not sure the reason), so it's never returned as 0.
Ext.getBody().addCls('x-no-scrollbar');
Ext.getBody().addCls(Ext.baseCSSPrefix+'no-scrollbar');
}
if (Ext.isWindows) {
// There are a few Extensible-specific CSS fixes required only on Windows
Ext.getBody().addCls('x-win');
Ext.getBody().addCls(Ext.baseCSSPrefix+'win');
}
if (Ext.getVersion('extjs').isLessThan('4.1')) {
// Unfortunately some styling changed in 4.1 that requires version-specific
// CSS differences to handle properly across versions. Ugh.
Ext.getBody().addCls('x-4-0');
Ext.getBody().addCls(Ext.baseCSSPrefix+'4-0');
}
}, this);
},
Expand Down
10 changes: 5 additions & 5 deletions src/calendar/CalendarPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ Ext.define('Extensible.calendar.CalendarPanel', {
});
}
if(this.showNavNextPrev) {
this.tbar.items.push({id: this.id+'-tb-prev', handler: this.onPrevClick, scope: this, iconCls: 'x-tbar-page-prev'});
this.tbar.items.push({id: this.id+'-tb-next', handler: this.onNextClick, scope: this, iconCls: 'x-tbar-page-next'});
this.tbar.items.push({id: this.id+'-tb-prev', handler: this.onPrevClick, scope: this, iconCls: Ext.baseCSSPrefix+'tbar-page-prev'});
this.tbar.items.push({id: this.id+'-tb-next', handler: this.onNextClick, scope: this, iconCls: Ext.baseCSSPrefix+'tbar-page-next'});
}
if(this.showNavJump) {
this.tbar.items.push(this.jumpToText);
Expand Down Expand Up @@ -307,7 +307,7 @@ Ext.define('Extensible.calendar.CalendarPanel', {

if(this.showNavBar === false) {
delete this.tbar;
this.addCls('x-calendar-nonav');
this.addCls(Ext.baseCSSPrefix+'calendar-nonav');
}

this.callParent(arguments);
Expand Down Expand Up @@ -544,7 +544,7 @@ Ext.define('Extensible.calendar.CalendarPanel', {
*/
});

this.addCls('x-cal-panel');
this.addCls(Ext.baseCSSPrefix+'cal-panel');

if(this.eventStore) {
this.store = this.eventStore;
Expand Down Expand Up @@ -668,7 +668,7 @@ Ext.define('Extensible.calendar.CalendarPanel', {
afterRender: function() {
this.callParent(arguments);

this.body.addCls('x-cal-body');
this.body.addCls(Ext.baseCSSPrefix+'cal-body');
this.updateNavState();
this.setActiveView();
},
Expand Down
2 changes: 1 addition & 1 deletion src/calendar/form/EventWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Ext.define('Extensible.calendar.form.EventWindow', {

// This junk spacer item gets added to the fbar by Ext (fixed in 4.0.2)
var junkSpacer = this.getDockedItems('toolbar')[0].items.items[0];
if (junkSpacer.el.hasCls('x-component-default')) {
if (junkSpacer.el.hasCls(Ext.baseCSSPrefix+'component-default')) {
Ext.destroy(junkSpacer);
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/calendar/form/field/CalendarCombo.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Ext.define('Extensible.calendar.form.field.CalendarCombo', {
forceSelection: true,
selectOnFocus: true,

defaultCls: 'x-cal-default',
defaultCls: Ext.baseCSSPrefix+'cal-default',
hiddenCalendarCls: 'ext-cal-hidden',

initComponent: function() {
Expand All @@ -46,7 +46,7 @@ Ext.define('Extensible.calendar.form.field.CalendarCombo', {
afterRender: function() {
this.callParent(arguments);

this.wrap = this.el.down('.x-form-item-body');
this.wrap = this.el.down('.'+Ext.baseCSSPrefix+'form-item-body');
this.wrap.addCls('ext-calendar-picker');

this.icon = Ext.core.DomHelper.append(this.wrap, {
Expand Down Expand Up @@ -78,7 +78,7 @@ Ext.define('Extensible.calendar.form.field.CalendarCombo', {
// this is a calendar id, need to get the record first then use its color
value = this.store.findRecord(calendarMappings.CalendarId.name, value);
}
colorCls = 'x-cal-' + (value.data ? value.data[calendarMappings.ColorId.name] : value);
colorCls = Ext.baseCSSPrefix+'cal-' + (value.data ? value.data[calendarMappings.ColorId.name] : value);
}

me.currentStyleClss = colorCls;
Expand Down
2 changes: 1 addition & 1 deletion src/calendar/gadget/CalendarListMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Ext.define('Extensible.calendar.gadget.CalendarListMenu', {
}]
});

this.addClass('x-calendar-list-menu');
this.addClass(Ext.baseCSSPrefix+'calendar-list-menu');
this.callParent(arguments);
},

Expand Down
4 changes: 2 additions & 2 deletions src/calendar/gadget/CalendarListPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Ext.define('Extensible.calendar.gadget.CalendarListPanel', {
*/

initComponent: function() {
this.addCls('x-calendar-list');
this.addCls(Ext.baseCSSPrefix+'calendar-list');
this.callParent(arguments);
},

Expand Down Expand Up @@ -126,7 +126,7 @@ Ext.define('Extensible.calendar.gadget.CalendarListPanel', {
},

getColorCls: function(colorId) {
return 'x-cal-'+colorId+'-ad';
return Ext.baseCSSPrefix+'cal-'+colorId+'-ad';
},

toggleCalendar: function(id, commit) {
Expand Down
10 changes: 5 additions & 5 deletions src/calendar/util/ColorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Ext.define('Extensible.calendar.util.ColorPicker', {
initComponent: function() {
this.callParent(arguments);

this.addCls('x-calendar-palette');
this.addCls(Ext.baseCSSPrefix+'calendar-palette');

if(this.handler) {
this.on('select', this.handler, this.scope || this, {
Expand All @@ -59,8 +59,8 @@ Ext.define('Extensible.calendar.util.ColorPicker', {
colorId;

Ext.each(classNames, function(className) {
if (className.indexOf('x-cal-') > -1) {
colorId = className.split('x-cal-')[1];
if (className.indexOf(Ext.baseCSSPrefix+'cal-') > -1) {
colorId = className.split(Ext.baseCSSPrefix+'cal-')[1];
return false;
}
});
Expand Down Expand Up @@ -88,9 +88,9 @@ Ext.define('Extensible.calendar.util.ColorPicker', {
var el = me.el;

if (me.value) {
el.down('.x-cal-' + value).removeCls(selectedCls);
el.down('.'+Ext.baseCSSPrefix+'cal-' + value).removeCls(selectedCls);
}
el.down('.x-cal-' + colorId).addCls(selectedCls);
el.down('.'+Ext.baseCSSPrefix+'cal-' + colorId).addCls(selectedCls);
me.value = colorId;

if (suppressEvent !== true) {
Expand Down
2 changes: 1 addition & 1 deletion src/calendar/view/Day.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Ext.define('Extensible.calendar.view.Day', {
// general to make sure that the window resize is good and done first
// so that we can properly calculate sizes.
Ext.defer(function() {
var ct = me.el.up('.x-panel-body'),
var ct = me.el.up('.'+Ext.baseCSSPrefix+'panel-body'),
header = me.el.down('.ext-cal-day-header'),
bodyHeight = ct ? ct.getHeight() - header.getHeight() : false;

Expand Down
4 changes: 2 additions & 2 deletions src/calendar/view/DayBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ Ext.define('Extensible.calendar.view.DayBody', {
var M = Extensible.calendar.data.EventMappings,
extraClasses = [this.getEventSelectorCls(evtData[M.EventId.name])],
data = {},
colorCls = 'x-cal-default',
colorCls = Ext.baseCSSPrefix+'cal-default',
title = evtData[M.Title.name],
fmt = Extensible.Date.use24HourTime ? 'G:i ' : 'g:ia ',
rec;
Expand All @@ -349,7 +349,7 @@ Ext.define('Extensible.calendar.view.DayBody', {
evtData[M.CalendarId.name]);

if (rec) {
colorCls = 'x-cal-' + rec.data[Extensible.calendar.data.CalendarMappings.ColorId.name];
colorCls = Ext.baseCSSPrefix+'cal-' + rec.data[Extensible.calendar.data.CalendarMappings.ColorId.name];
}
}
colorCls += (evtData._renderAsAllDay ? '-ad' : '') + (Ext.isIE || Ext.isOpera ? '-x' : '');
Expand Down
4 changes: 2 additions & 2 deletions src/calendar/view/Month.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ Ext.define('Extensible.calendar.view.Month', {
var M = Extensible.calendar.data.EventMappings,
extraClasses = [this.getEventSelectorCls(evtData[M.EventId.name])],
templateData = {},
colorCls = 'x-cal-default',
colorCls = Ext.baseCSSPrefix+'cal-default',
title = evtData[M.Title.name],
fmt = Extensible.Date.use24HourTime ? 'G:i ' : 'g:ia ',
rec;

if (this.calendarStore && evtData[M.CalendarId.name]) {
rec = this.calendarStore.findRecord(Extensible.calendar.data.CalendarMappings.CalendarId.name, evtData[M.CalendarId.name]);
if(rec) {
colorCls = 'x-cal-' + rec.get(Extensible.calendar.data.CalendarMappings.ColorId.name);
colorCls = Ext.baseCSSPrefix+'cal-' + rec.get(Extensible.calendar.data.CalendarMappings.ColorId.name);
}
}
colorCls += (evtData._renderAsAllDay ? '-ad' : '');
Expand Down
4 changes: 2 additions & 2 deletions src/form/field/DateRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ Ext.define('Extensible.form.field.DateRange', {
if(me.singleLine === 'auto') {
var ownerCtEl = me.ownerCt.getEl(),
w = me.ownerCt.getWidth() - ownerCtEl.getPadding('lr'),
el = ownerCtEl.down('.x-panel-body');
el = ownerCtEl.down('.'+Ext.baseCSSPrefix+'panel-body');

if(el) {
w -= el.getPadding('lr');
}

el = ownerCtEl.down('.x-form-item-label');
el = ownerCtEl.down('.'+Ext.baseCSSPrefix+'form-item-label');

if(el) {
w -= el.getWidth() - el.getPadding('lr');
Expand Down