mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX PHP Linter fixes
This commit is contained in:
parent
aec1d542b1
commit
026b64cafb
@ -8,10 +8,10 @@ gulp.task("scss", function () {
|
|||||||
.pipe(gulp.dest("./css"));
|
.pipe(gulp.dest("./css"));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('watch', ['scss'], function() {
|
gulp.task('watch', ['scss'], function () {
|
||||||
gulp.watch('./scss/*.scss', ['scss']);
|
gulp.watch('./scss/*.scss', ['scss']);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('default', ['scss'], function() {
|
gulp.task('default', ['scss'], function () {
|
||||||
// noop
|
// noop
|
||||||
});
|
});
|
||||||
|
26
js/cms.js
26
js/cms.js
@ -10,9 +10,9 @@
|
|||||||
* @see https://github.com/silverstripe/silverstripe-blog/issues/210
|
* @see https://github.com/silverstripe/silverstripe-blog/issues/210
|
||||||
*/
|
*/
|
||||||
$('.cms-content-fields > #Form_EditForm_error').entwine({
|
$('.cms-content-fields > #Form_EditForm_error').entwine({
|
||||||
'onadd': function() {
|
'onadd': function () {
|
||||||
var $target = $('.blog-admin-outer');
|
var $target = $('.blog-admin-outer');
|
||||||
if($target.length == 1) {
|
if ($target.length == 1) {
|
||||||
$target.prepend(this);
|
$target.prepend(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@
|
|||||||
*/
|
*/
|
||||||
var shown = false;
|
var shown = false;
|
||||||
|
|
||||||
$this.on('click', function() {
|
$this.on('click', function () {
|
||||||
$this.parent().next('.description')[shown ? 'hide' : 'show']();
|
$this.parent().next('.description')[shown ? 'hide' : 'show']();
|
||||||
|
|
||||||
$this.toggleClass('toggle-description-shown');
|
$this.toggleClass('toggle-description-shown');
|
||||||
@ -65,21 +65,21 @@
|
|||||||
* Custom merge actions for tags and categories
|
* Custom merge actions for tags and categories
|
||||||
*/
|
*/
|
||||||
$('.MergeAction').entwine({
|
$('.MergeAction').entwine({
|
||||||
'onadd': function() {
|
'onadd': function () {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
|
||||||
$this.on('click', 'select', function() {
|
$this.on('click', 'select', function () {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$this.children('button').each(function(i, button) {
|
$this.children('button').each(function (i, button) {
|
||||||
var $button = $(button);
|
var $button = $(button);
|
||||||
var $select = $button.prev('select');
|
var $select = $button.prev('select');
|
||||||
|
|
||||||
$button.before('<input type="hidden" name="' + $button.attr('data-target') + '" value="' + $select.val() + '" />');
|
$button.before('<input type="hidden" name="' + $button.attr('data-target') + '" value="' + $select.val() + '" />');
|
||||||
});
|
});
|
||||||
|
|
||||||
$this.on('change', 'select', function(e) {
|
$this.on('change', 'select', function (e) {
|
||||||
var $target = $(e.target);
|
var $target = $(e.target);
|
||||||
|
|
||||||
$target.next('input').val($target.val());
|
$target.next('input').val($target.val());
|
||||||
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
$this.children('button, select').hide();
|
$this.children('button, select').hide();
|
||||||
|
|
||||||
$this.on('click', '.MergeActionReveal', function(e) {
|
$this.on('click', '.MergeActionReveal', function (e) {
|
||||||
var $target = $(e.target);
|
var $target = $(e.target);
|
||||||
|
|
||||||
$target.parent().children('button, select').show();
|
$target.parent().children('button, select').show();
|
||||||
@ -105,20 +105,20 @@
|
|||||||
*/
|
*/
|
||||||
$('.blog-admin-sidebar.cms-panel').entwine({
|
$('.blog-admin-sidebar.cms-panel').entwine({
|
||||||
MinInnerWidth: 620,
|
MinInnerWidth: 620,
|
||||||
onadd: function() {
|
onadd: function () {
|
||||||
this._super();
|
this._super();
|
||||||
this.updateLayout();
|
this.updateLayout();
|
||||||
|
|
||||||
// If this panel is open and the left hand column is smaller than the minimum, contract it instead
|
// If this panel is open and the left hand column is smaller than the minimum, contract it instead
|
||||||
if(!this.hasClass('collapsed') && ($(".blog-admin-outer").width() < this.getMinInnerWidth())) {
|
if (!this.hasClass('collapsed') && ($(".blog-admin-outer").width() < this.getMinInnerWidth())) {
|
||||||
this.collapsePanel();
|
this.collapsePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onresize = function() {
|
window.onresize = function () {
|
||||||
this.updateLayout();
|
this.updateLayout();
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
},
|
},
|
||||||
togglePanel: function(bool, silent) {
|
togglePanel: function (bool, silent) {
|
||||||
this._super(bool, silent);
|
this._super(bool, silent);
|
||||||
this.updateLayout();
|
this.updateLayout();
|
||||||
},
|
},
|
||||||
@ -127,7 +127,7 @@
|
|||||||
*
|
*
|
||||||
* @returns {undefined}
|
* @returns {undefined}
|
||||||
*/
|
*/
|
||||||
updateLayout: function() {
|
updateLayout: function () {
|
||||||
$(this).css('height', '100%');
|
$(this).css('height', '100%');
|
||||||
var currentHeight = $(this).outerHeight();
|
var currentHeight = $(this).outerHeight();
|
||||||
var bottomHeight = $('.cms-content-actions').eq(0).outerHeight();
|
var bottomHeight = $('.cms-content-actions').eq(0).outerHeight();
|
||||||
|
Loading…
Reference in New Issue
Block a user