Baidu editor Custom button styles (I can't afford to write it in cssRules )?

Source: Internet
Author: User
{Code ...}
UE. registerUI ('Dialog ', function (editor, uiName) {// create dialog var dialog = new UE. ui. dialog ({// specify the page path in the pop-up layer. Only pages are supported here, because. js has the same directory, so you do not need to add the path iframeUrl: '/address', // you need to specify the current editor instance editor: UEditor, // specify the dialog name: uiName, // dialog title: "Search for a Poi", // specify the dialog peripheral style cssRules: "width: 600px; height: 300px ;", // If buttons is provided, it indicates that the dialog has been determined and the buttons: [{className: 'edui-okbutton ', label: 'insert', onclick: fun Ction () {dialog. close (true) ;},{ className: 'edui-cancelbutton ', label: 'cancel', onclick: function () {dialog. close (false) ;}}]}); // refer to addCustomizeButton. js var btn = new UE. ui. button ({name: 'dialogbutton' + uiName, title: 'insert poi', // The extra style to be added. Specify the icon. A duplicate icon cssRules is used by default: 'background-image: url (image address) ', onclick: function () {// render dialog. render (); dialog. open () ;}}); return btn ;}); edited in Baidu Edit the Custom button in the editor and use your own image as the button image. The specified image cannot achieve the effect.

Reply content:
UE. registerUI ('Dialog ', function (editor, uiName) {// create dialog var dialog = new UE. ui. dialog ({// specify the page path in the pop-up layer. Only pages are supported here, because. js has the same directory, so you do not need to add the path iframeUrl: '/address', // you need to specify the current editor instance editor: UEditor, // specify the dialog name: uiName, // dialog title: "Search for a Poi", // specify the dialog peripheral style cssRules: "width: 600px; height: 300px ;", // If buttons is provided, it indicates that the dialog has been determined and the buttons: [{className: 'edui-okbutton ', label: 'insert', onclick: fun Ction () {dialog. close (true) ;},{ className: 'edui-cancelbutton ', label: 'cancel', onclick: function () {dialog. close (false) ;}}]}); // refer to addCustomizeButton. js var btn = new UE. ui. button ({name: 'dialogbutton' + uiName, title: 'insert poi', // The extra style to be added. Specify the icon. A duplicate icon cssRules is used by default: 'background-image: url (image address) ', onclick: function () {// render dialog. render (); dialog. open () ;}}); return btn ;}); edited in Baidu Edit the Custom button in the editor and use your own image as the button image. The specified image cannot achieve the effect.

It is generally customized in defaul.css.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.