Skip to content

Commit

Permalink
Merge pull request #248 from cobicarmel/feature/box-shadow
Browse files Browse the repository at this point in the history
Feature/box shadow
  • Loading branch information
KingYes committed Jul 12, 2016
2 parents 474afa5 + e5ebd30 commit e65b19b
Show file tree
Hide file tree
Showing 36 changed files with 1,428 additions and 450 deletions.
155 changes: 64 additions & 91 deletions assets/admin/js/app.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions assets/admin/js/app.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion assets/admin/js/dev/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ App = Marionette.Application.extend( {
gallery: require( 'elementor-views/controls/gallery' ),
select2: require( 'elementor-views/controls/select2' ),
box_shadow: require( 'elementor-views/controls/box-shadow' ),
structure: require( 'elementor-views/controls/structure' )
structure: require( 'elementor-views/controls/structure' ),
animation: require( 'elementor-views/controls/animation' )
};

this.editor.trigger( 'editor:controls:initialize' );
Expand Down
11 changes: 11 additions & 0 deletions assets/admin/js/dev/views/controls/animation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var ControlBaseItemView = require( 'elementor-views/controls/base' ),
ControlAnimationItemView;

ControlAnimationItemView = ControlBaseItemView.extend( {

onReady: function() {
this.ui.select.select2();
}
} );

module.exports = ControlAnimationItemView;
51 changes: 18 additions & 33 deletions assets/admin/js/dev/views/controls/box-shadow.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ControlBoxShadowItemView = ControlMultipleBaseItemView.extend( {
ui: function() {
var ui = ControlMultipleBaseItemView.prototype.ui.apply( this, arguments );

ui.sliders = '.elementor-control-slider';
ui.sliders = '.elementor-slider';
ui.colors = '.elementor-box-shadow-color-picker';

return ui;
Expand All @@ -20,55 +20,40 @@ ControlBoxShadowItemView = ControlMultipleBaseItemView.extend( {

this.ui.sliders.each( function() {
var $slider = Backbone.$( this ),
$input = $slider.next( '.elementor-control-slider-input' ).find( 'input' ),
min = Number( $input.attr( 'min' ) ),
max = Number( $input.attr( 'max' ) );
$input = $slider.next( '.elementor-slider-input' ).find( 'input' );

$slider.slider( {
value: value[ this.dataset.input ],
min: min,
max: max
min: +$input.attr( 'min' ),
max: +$input.attr( 'max' )
} );
} );
},

initColors: function() {
var $colors = this.ui.colors,
self = this;
var self = this;

$colors.each( function() {
var $color = Backbone.$( this );

$color.wpColorPicker( {
change: function() {
var type = $color.data( 'setting' );

self.setValue( type, $color.wpColorPicker( 'color' ) );
},
this.ui.colors.wpColorPicker( {
change: function() {
var $this = Backbone.$( this ),
type = $this.data( 'setting' );

clear: function() {
var type = $color.data( 'setting' );
self.setValue( type, $this.wpColorPicker( 'color' ) );
},

self.setValue( type, '' );
},
clear: function() {
self.setValue( this.dataset.setting, '' );
},

width: 251
} );
width: 251
} );
},

onInputChange: function( event ) {
var type = event.currentTarget.dataset.setting,
$slider = this.ui.sliders.filter( '[data-input="' + type + '"]' ),
$input = Backbone.$( event.currentTarget ),
min = Number( $input.attr( 'min' ) ),
max = Number( $input.attr( 'max' ) );

$slider.slider( {
value: this.getControlValue( type ),
min: min,
max: max
} );
$slider = this.ui.sliders.filter( '[data-input="' + type + '"]' );

$slider.slider( 'value', this.getControlValue( type ) );
},

onReady: function() {
Expand Down
16 changes: 1 addition & 15 deletions assets/admin/js/dev/views/controls/font.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,12 @@ var ControlBaseItemView = require( 'elementor-views/controls/base' ),
ControlFontItemView;

ControlFontItemView = ControlBaseItemView.extend( {
ui: function() {
var ui = ControlBaseItemView.prototype.ui.apply( this, arguments );

ui.fontSelect = '.elementor-control-font-family';

return ui;
},
onReady: function() {
this.ui.fontSelect.select2( {
this.ui.select.select2( {
dir: elementor.config.is_rtl ? 'rtl' : 'ltr'
} );
},

onBeforeDestroy: function() {
if ( this.ui.fontSelect.data( 'select2' ) ) {
this.ui.fontSelect.select2( 'destroy' );
}
this.$el.remove();
},

templateHelpers: function() {
var helpers = ControlBaseItemView.prototype.templateHelpers.apply( this, arguments );

Expand Down
16 changes: 1 addition & 15 deletions assets/admin/js/dev/views/controls/icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ var ControlBaseItemView = require( 'elementor-views/controls/base' ),
ControlIconItemView;

ControlIconItemView = ControlBaseItemView.extend( {
ui: function() {
var ui = ControlBaseItemView.prototype.ui.apply( this, arguments );

ui.iconSelect = '.elementor-control-icon';

return ui;
},

initialize: function() {
ControlBaseItemView.prototype.initialize.apply( this, arguments );
Expand Down Expand Up @@ -56,18 +49,11 @@ ControlIconItemView = ControlBaseItemView.extend( {
},

onReady: function() {
this.ui.iconSelect.select2( {
this.ui.select.select2( {
allowClear: true,
templateResult: _.bind( this.iconsList, this ),
templateSelection: _.bind( this.iconsList, this )
} );
},

onBeforeDestroy: function() {
if ( this.ui.iconSelect.data( 'select2' ) ) {
this.ui.iconSelect.select2( 'destroy' );
}
this.$el.remove();
}
} );

Expand Down
2 changes: 2 additions & 0 deletions assets/admin/js/dev/views/controls/select2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Attention: DO NOT use this control since it has bugs
// TODO: This control is unused
var ControlBaseItemView = require( 'elementor-views/controls/base' ),
ControlSelect2ItemView;

Expand Down
2 changes: 1 addition & 1 deletion assets/admin/js/dev/views/controls/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ControlSliderItemView = ControlBaseUnitsItemView.extend( {
ui: function() {
var ui = ControlBaseUnitsItemView.prototype.ui.apply( this, arguments );

ui.slider = '.elementor-control-slider';
ui.slider = '.elementor-slider';

return ui;
},
Expand Down
88 changes: 40 additions & 48 deletions assets/css/editor-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/editor-rtl.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit e65b19b

Please sign in to comment.