Permalink
Browse files

added variables for toolbar css, added buttons to modal window, added…

… better css for switcher menu
  • Loading branch information...
1 parent a3f3fbc commit f02ce1ce7ad892c67fcb95dd9aa5894751c644b1 @FinalAngel FinalAngel committed Jan 24, 2013

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -151,7 +151,7 @@
'items': '.cms_draggable',
'handle': '.cms_dragitem',
'listType': 'ul',
- 'opacity': 0.2,
+ 'opacity': 0.4,
'tolerance': 'pointer',
'toleranceElement': '> div',
'cursor': 'move',
@@ -167,6 +167,7 @@
// getting restriction array
var bounds = [];
var plugin = $('#cms_plugin-' + that.getId(originalItem));
+
var bar = placeholder.parent().prevAll('.cms_placeholder-bar').first();
var type = plugin.data('settings').plugin_type;
@@ -437,7 +438,6 @@
plugin.insertAfter($('#cms_plugin-' + parent_id));
} else {
// if we dont find out, we need to figure out where it belongs and get the previous item
- console.log(dragitem.parent().parent().next());
dragitem.parent().parent().next().prepend(plugin);
}
@@ -115,15 +115,39 @@ $(document).ready(function () {
});
});
- // attach event to the sidebar
- this.sideframe.bind('dblclick', function () {
- that._hideSideframe();
+ // module events
+ this._eventsSidebar();
+ this._eventsDialog();
+ this._eventsModal();
+
+ // stopper events
+ $(document).bind('mouseup.cms', function (e) {
+ that._stopSideframeResize();
+ that._endModalMove(e);
+ that._endModalResize(e);
});
- this.sideframe.find('.cms_sideframe-resize').bind('mousedown', function (e) {
+
+ // event for switching between edit and layout mode
+ this.menu.bind('click', function (e) {
+ ($(this).hasClass('cms_placeholders-menu-alternate')) ? that._enableEditMode(300) : that._enableDragMode(300);
+ // reset dragholders
+ // TODO this is new placeholders
+ $('.cms_draggable').removeClass('cms_draggable-selected');
+ // attach active class to current element
+ var id = $(this).data('id');
+ $('#cms_draggable-' + id).addClass('cms_draggable-selected');
+ });
+ this.toolbar.find('.cms_toolbar-item_buttons li a').eq(0).bind('click', function (e) {
e.preventDefault();
- that._startSideframeResize();
+ that._enableEditMode(300);
});
+ this.toolbar.find('.cms_toolbar-item_buttons li a').eq(1).bind('click', function (e) {
+ e.preventDefault();
+ that._enableDragMode(300);
+ });
+ },
+ _eventsDialog: function () {
// attach events to the dialogue window
this.dialogue.find('.cms_dialogue-confirm').bind('click', function (e) {
e.preventDefault();
@@ -137,6 +161,23 @@ $(document).ready(function () {
e.preventDefault();
that._hideDialogue();
});
+ },
+
+ _eventsSidebar: function () {
+ var that = this;
+
+ // attach event to the sidebar
+ this.sideframe.bind('dblclick', function () {
+ that._hideSideframe();
+ });
+ this.sideframe.find('.cms_sideframe-resize').bind('mousedown', function (e) {
+ e.preventDefault();
+ that._startSideframeResize();
+ });
+ },
+
+ _eventsModal: function () {
+ var that = this;
// attach events to window
this.modal.find('.cms_modal-close').bind('click', function (e) {
@@ -159,31 +200,13 @@ $(document).ready(function () {
e.preventDefault();
that._changeModalContent($(this));
});
-
- // stopper events
- $(document).bind('mouseup.cms', function (e) {
- that._stopSideframeResize();
- that._endModalMove(e);
- that._endModalResize(e);
- });
-
- // event for switching between edit and layout mode
- this.menu.bind('click', function (e) {
- ($(this).hasClass('cms_placeholders-menu-alternate')) ? that._enableEditMode(300) : that._enableDragMode(300);
- // reset dragholders
- // TODO this is new placeholders
- $('.cms_draggable').removeClass('cms_draggable-selected');
- // attach active class to current element
- var id = $(this).data('id');
- $('#cms_draggable-' + id).addClass('cms_draggable-selected');
- });
- this.toolbar.find('.cms_toolbar-item_buttons li a').eq(0).bind('click', function (e) {
+ this.modal.find('.cms_modal-cancel').bind('click', function (e) {
e.preventDefault();
- that._enableEditMode(300);
+ that._hideModal(100);
});
- this.toolbar.find('.cms_toolbar-item_buttons li a').eq(1).bind('click', function (e) {
+ this.modal.find('.cms_modal-save').bind('click', function (e) {
e.preventDefault();
- that._enableDragMode(300);
+ that._saveModal();
});
},
@@ -592,6 +615,10 @@ $(document).ready(function () {
$(document).unbind('mousemove.cms');
},
+ _saveModal: function () {
+ this.modal.find('iframe').contents().find('form').submit();
+ },
+
_changeModalContent: function (el) {
if(el.hasClass('cms_modal-breadcrumb-last')) return false;
Oops, something went wrong.

0 comments on commit f02ce1c

Please sign in to comment.