API-CHANGE: ssui.core.js rewrite to work with jQuery UI 1.8. Renamed _init => _create and renamed defaults => options. See the following websites for a complete guide to what has changed in jquery UI version 1.8:

https://github.com/scottgonzalez/jquery-ui-1.8-widget-factory
http://jqueryui.com/docs/Upgrade_Guide
This commit is contained in:
Julian Seidenberg 2011-02-24 17:12:19 +13:00
parent f380d88c80
commit 86fa29accc

View File

@ -1,6 +1,6 @@
(function($) { (function($) {
$.widget("ssui.titlebar", { $.widget("ssui.titlebar", {
_init: function() { _create: function() {
this.originalTitle = this.element.attr('title'); this.originalTitle = this.element.attr('title');
var self = this; var self = this;
@ -8,7 +8,7 @@
var title = options.title || this.originalTitle || ' '; var title = options.title || this.originalTitle || ' ';
var titleId = $.ui.dialog.getTitleId(this.element); var titleId = $.ui.dialog.getTitleId(this.element);
this.element.parent().addClass('ui-dialog'); this.element.parent().addClass('ui-dialog');
var uiDialogTitlebar = this.element. var uiDialogTitlebar = this.element.
@ -18,8 +18,8 @@
'ui-corner-all ' + 'ui-corner-all ' +
'ui-helper-clearfix' 'ui-helper-clearfix'
); );
// By default, the // By default, the
if(options.closeButton) { if(options.closeButton) {
var uiDialogTitlebarClose = $('<a href="#"/>') var uiDialogTitlebarClose = $('<a href="#"/>')
@ -46,7 +46,7 @@
ev.stopPropagation(); ev.stopPropagation();
}) })
.appendTo(uiDialogTitlebar); .appendTo(uiDialogTitlebar);
var uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>')) var uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
.addClass( .addClass(
'ui-icon ' + 'ui-icon ' +
@ -55,13 +55,13 @@
.text(options.closeText) .text(options.closeText)
.appendTo(uiDialogTitlebarClose); .appendTo(uiDialogTitlebarClose);
} }
var uiDialogTitle = $('<span/>') var uiDialogTitle = $('<span/>')
.addClass('ui-dialog-title') .addClass('ui-dialog-title')
.attr('id', titleId) .attr('id', titleId)
.html(title) .html(title)
.prependTo(uiDialogTitlebar); .prependTo(uiDialogTitlebar);
uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
}, },
@ -78,7 +78,7 @@
$.extend($.ssui.titlebar, { $.extend($.ssui.titlebar, {
version: "0.0.1", version: "0.0.1",
defaults: { options: {
title: '', title: '',
closeButton: false, closeButton: false,
closeText: 'close' closeText: 'close'