Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions administrator/components/com_finder/models/forms/filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true" />

<field
name="title" type="text" id="title"
class="input-xxlarge input-large-text"
label="JGLOBAL_TITLE" description="COM_FINDER_FILTER_TITLE_DESCRIPTION"
size="40" default="" required="true" />
<field name="title" type="text" label="JGLOBAL_TITLE"
description="COM_FINDER_FILTER_TITLE_DESCRIPTION"
class="input-xxlarge input-large-text"
size="40"
id="title"
required="true" />

<field name="alias" type="text" label="JFIELD_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
Expand Down
10 changes: 10 additions & 0 deletions administrator/components/com_finder/views/filter/tmpl/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
JHtml::_('behavior.formvalidator');
JHtml::_('behavior.keepalive');
JHtml::_('formbehavior.chosen', 'select');

JFactory::getDocument()->addScriptDeclaration('
Joomla.submitbutton = function(task)
{
if (task == "filter.cancel" || document.formvalidator.isValid(document.getElementById("adminForm")))
{
Joomla.submitform(task, document.getElementById("adminForm"));
}
};
');
?>

<form action="<?php echo JRoute::_('index.php?option=com_finder&view=filter&layout=edit&filter_id=' . (int) $this->item->filter_id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate">
Expand Down
12 changes: 11 additions & 1 deletion components/com_finder/helpers/html/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ public static function slider($options = array())
if ($loadMedia)
{
JHtml::_('stylesheet', 'com_finder/sliderfilter.css', false, true, false);
JHtml::_('script', 'com_finder/sliderfilter.js', false, true);

if (JFactory::getDocument()->direction == 'rtl')
{
JHtml::_('stylesheet', 'com_finder/finder-rtl.css', false, true, false);
}
JHtml::_('script', 'com_finder/sliderfilter.js', true, true);
}

// Load plug-in language files.
Expand Down Expand Up @@ -432,6 +437,11 @@ public static function select($idxQuery, $options)
if ($loadMedia)
{
JHtml::stylesheet('com_finder/sliderfilter.css', false, true, false);

if (JFactory::getDocument()->direction == 'rtl')
{
JHtml::_('stylesheet', 'com_finder/finder-rtl.css', false, true, false);
}
}

return $html;
Expand Down
26 changes: 26 additions & 0 deletions media/com_finder/css/finder-rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.checklist {
float: right;
}

.checklist {
border-right-width: 0;
}

#filter_lists div {
float: right;
}

.checklist dt,
#branch-selectors dt {
padding: 0 2px 2px 0;
text-align: right;
}

.checklist,
.checklist dd,
#branch-selectors dd,
.checklist div.control-group,
#branch-selectors div.control-group {
padding: 0 2px 0 0;
text-align: right;
}
13 changes: 11 additions & 2 deletions media/com_finder/css/sliderfilter.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
overflow: auto;
}

.checklist,
#branch-selectors {
.checklist {
border: 1px solid #ccc;
height: 220px;
overflow: auto;
width: 220px;
float: left;
margin: 0;
overflow-x: hidden;
-ms-overflow-y: auto;
-ms-overflow-x: hidden;
}

#branch-selectors {
display:none;
}

#finder-filter-window dl {
Expand All @@ -24,6 +30,9 @@
.checklist {
border-left-width: 0;
}
dl.checklist {
border: 1px solid #ccc;
}

#filter_lists div {
float: left;
Expand Down
37 changes: 2 additions & 35 deletions media/com_finder/js/sliderfilter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FinderFilter = new Class({

Extends: Fx.Elements,
Implements: [Options, Events],
Extends: Fx,

options: {
onActive: Class.empty,
Expand All @@ -20,24 +21,7 @@ FinderFilter = new Class({
this.frame = document.id(frame);

this.effects = {};
if (this.options.opacity) this.effects.opacity = 'fullOpacity';
if (this.options.width) this.effects.width = this.options.fixedWidth ? 'fullWidth' : 'offsetWidth';
this.container.setStyle('width', '230px');

this.addEvent('onActive', function (toggler, element) {
element.set('styles', {
'border-top': '1px solid #ccc',
'border-right': '1px solid #ccc',
'border-bottom': '1px solid #ccc',
'overflow': 'auto'
});
this.container.set('styles', {
width: this.container.getStyle('width').toInt() + element.fullWidth
});
coord = element.getCoordinates([this.frame]);
scroller = new Fx.Scroll(frame);
scroller.start(coord.top, coord.left);
});
this.addEvent('onBackground', function () {
el = this.elements[this.active];
el.getElements('input').each(function (n) {
Expand Down Expand Up @@ -102,16 +86,8 @@ FinderFilter = new Class({
}
var idx = this.togglers.indexOf(toggler);
toggler.addEvent('click', this.toggle.bind(this, idx));
if (this.options.width) element.set('styles', {
'padding-left': 0,
'border-left': 'none',
'padding-right': 0,
'border-right': 'none'
});
element.fullOpacity = 1;
if (this.options.fixedWidth) element.fullWidth = this.options.fixedWidth;
if (this.options.fixedHeight) element.fullHeight = this.options.fixedHeight;
element.set('styles', {'overflow': 'hidden'});
return this;
},

Expand All @@ -137,13 +113,4 @@ FinderFilter = new Class({

window.addEvent('domready', function () {
Filter = new FinderFilter(document.getElements('input.toggler'), document.getElements('dl.checklist'), document.id('finder-filter-container'), document.id('finder-filter-window'));
document.id('tax-select-all').addEvent('change', function () {
if (document.id('tax-select-all').getProperty('checked')) {
document.id('finder-filter-window').getElements('input').each(function (input) {
if (input.getProperty('id') != 'tax-select-all') {
input.removeProperty('checked');
}
});
}
});
});