Skip to content

Commit 0b1df35

Browse files
Device Specific CSS + Bug Fixes (Feature Badge + Article Rating remove. Minor Fix + Margin Padding)
1 parent c98fd28 commit 0b1df35

File tree

14 files changed

+471
-156
lines changed

14 files changed

+471
-156
lines changed

astroid/astroid-framework/assets/css/astroid-menu-options.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

astroid/astroid-framework/assets/css/astroid-menu-options.css.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

astroid/astroid-framework/assets/js/astroid-framework.js

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,44 @@ astroidFramework.directive("astroidspacing", ["$http", function ($http) {
184184
['top', 'right', 'bottom', 'left', 'unit'].forEach(function (_prop) {
185185
$element.find('[data-device=' + _device + '][data-attr=' + _prop + ']').val(_value[_device][_prop]);
186186
});
187+
if (_value[_device].lock) {
188+
$element.find('button[data-device=' + _device + ']').removeClass('btn-light').addClass('btn-purple').addClass('active');
189+
} else {
190+
$element.find('button[data-device=' + _device + ']').removeClass('btn-purple').removeClass('active').addClass('btn-light');
191+
}
192+
193+
if (_value[_device].lock) {
194+
['right', 'bottom', 'left'].forEach(function (_prop) {
195+
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').prop('disabled', true);
196+
});
197+
} else {
198+
['right', 'bottom', 'left'].forEach(function (_prop) {
199+
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').prop('disabled', false);
200+
});
201+
}
202+
187203
});
188204

189205
}, 100);
190206

207+
$scope.setDevice = function (_device) {
208+
$element.find('a').removeClass('active');
209+
$element.find('a[data-device=' + _device + ']').addClass('active');
210+
$element.find('.astroid-spacing-field').addClass('d-none');
211+
$element.find('.astroid-spacing-field[data-device=' + _device + ']').removeClass('d-none');
212+
}
213+
214+
$scope.setDevice('desktop');
215+
191216
$scope.updateInput = function (_input) {
192217
var _device = _input.data('device');
193218
var _attr = _input.data('attr');
194219
_value[_device][_attr] = _input.val();
195220
if (_attr == 'top' && _value[_device].lock) {
196221
var _topVal = _value[_device][_attr];
197-
['right', 'bottom', 'left', 'unit'].forEach(function (_prop) {
222+
['right', 'bottom', 'left'].forEach(function (_prop) {
198223
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').val(_topVal);
224+
_value[_device][_prop] = _topVal;
199225
});
200226
}
201227
$element.find('textarea').val(JSON.stringify(_value));
@@ -215,23 +241,29 @@ astroidFramework.directive("astroidspacing", ["$http", function ($http) {
215241

216242
$scope.switchLock = function (_device) {
217243
_value[_device].lock = !_value[_device].lock;
218-
$element.find('textarea').val(JSON.stringify(_value));
219244
$scope.updateLock(_device);
220245
}
221246

222247
$scope.updateLock = function (_device) {
223248
if (_value[_device].lock) {
224249
var _topVal = $element.find('input[data-device=' + _device + '][data-attr=top]').val();
225-
['right', 'bottom', 'left', 'unit'].forEach(function (_prop) {
250+
['right', 'bottom', 'left'].forEach(function (_prop) {
226251
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').val(_topVal);
227252
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').prop('disabled', true);
253+
_value[_device][_prop] = _topVal;
228254
});
229255
$element.find('input[data-device=' + _device + '][data-attr=top]').focus();
230256
} else {
231-
['right', 'bottom', 'left', 'unit'].forEach(function (_prop) {
257+
['right', 'bottom', 'left'].forEach(function (_prop) {
232258
$element.find('input[data-device=' + _device + '][data-attr=' + _prop + ']').prop('disabled', false);
233259
});
234260
}
261+
if (_value[_device].lock) {
262+
$element.find('button[data-device=' + _device + ']').removeClass('btn-light').addClass('btn-purple').addClass('active');
263+
} else {
264+
$element.find('button[data-device=' + _device + ']').removeClass('btn-purple').removeClass('active').addClass('btn-light');
265+
}
266+
$element.find('textarea').val(JSON.stringify(_value));
235267
}
236268
}
237269
}

astroid/astroid-framework/assets/js/astroid.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

astroid/astroid-framework/framework/article.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ function __construct($article, $categoryView = false)
3131

3232
$mainframe = JFactory::getApplication();
3333
$this->params = new JRegistry();
34-
$itemId = $mainframe->input->get('Itemid', 0);
34+
$itemId = $mainframe->input->get('Itemid', 0, 'INT');
3535
if ($itemId) {
3636
$menu = $mainframe->getMenu();
3737
$item = $menu->getItem($itemId);
38-
if ($item->query['option'] == 'com_content' && ($item->query['view'] == 'category' || $item->query['view'] == 'article')) {
38+
if ($item->query['option'] == 'com_content' && ($item->query['view'] == 'category' || $item->query['view'] == 'article' || $item->query['view'] == 'featured')) {
3939
$this->params = $item->params;
4040
}
4141
}
@@ -334,10 +334,12 @@ public function showRating()
334334
return FALSE;
335335
}
336336

337-
$menu_level = $this->params->get('article_rating', '');
338-
$article_level = $this->article->params->get('article_rating', '');
337+
if (!$this->article->params->get('show_vote', 0)) {
338+
return FALSE;
339+
}
340+
339341
$astroid_level = $this->template->params->get('article_rating', 1);
340-
return $this->checkPriority('', $article_level, $astroid_level);
342+
return $astroid_level ? true : false;
341343
}
342344

343345
// Utility Functions

0 commit comments

Comments
 (0)