Skip to content

Commit

Permalink
add custom css to dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
David Epely committed Apr 30, 2012
1 parent 8eecffd commit 4b398bb
Show file tree
Hide file tree
Showing 2 changed files with 3,376 additions and 5 deletions.
18 changes: 15 additions & 3 deletions jquery.sceditor.js
Expand Up @@ -448,6 +448,7 @@
* IE from deselecting the text in the editor * IE from deselecting the text in the editor
*/ */
base.createDropDown = function (menuItem, dropDownName, content, ieUnselectable) { base.createDropDown = function (menuItem, dropDownName, content, ieUnselectable) {

base.closeDropDown(); base.closeDropDown();


// IE needs unselectable attr to stop it from unselecting the text in the editor. // IE needs unselectable attr to stop it from unselecting the text in the editor.
Expand All @@ -460,10 +461,16 @@
//var menuItemPosition = menuItem.position(); //var menuItemPosition = menuItem.position();
//var editorContainerPosition = editorContainer.position(); //var editorContainerPosition = editorContainer.position();


$dropdown = $('<div class="sceditor-dropdown sceditor-' + dropDownName + '" />').css({ var o_css = {
top: menuItem.offset().top, top: menuItem.offset().top,
left: menuItem.offset().left left: menuItem.offset().left
}).append(content); }

$.extend(o_css,base.options.dropDownCss);

console.log(o_css);

$dropdown = $('<div class="sceditor-dropdown sceditor-' + dropDownName + '" />').css(o_css).append(content);


//editorContainer.after($dropdown); //editorContainer.after($dropdown);
$dropdown.appendTo($('body')); $dropdown.appendTo($('body'));
Expand Down Expand Up @@ -2328,7 +2335,12 @@
// date format. year, month and day will be replaced with the users current year, month and day. // date format. year, month and day will be replaced with the users current year, month and day.
dateFormat: "year-month-day", dateFormat: "year-month-day",


toolbarContainer: null toolbarContainer: null,

//add css to dropdown menu (eg. z-index)
dropDownCss: {
"z-index" : "auto"
}
}; };


$.fn.sceditor = function (options) { $.fn.sceditor = function (options) {
Expand Down

0 comments on commit 4b398bb

Please sign in to comment.