Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #41 from zyhfish/bug/DNN-8065
Browse files Browse the repository at this point in the history
DNN-8065: sync title attribute with alt value when save image.
  • Loading branch information
agrueso committed Dec 4, 2015
2 parents 57111a2 + 54c031f commit d032df8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions DNNConnect.CKEditorProvider.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
<Content Include="css\jquery.notification.css" />
<Content Include="css\Options.css" />
<Content Include="Install\DNNCkeditor.license.txt" />
<Content Include="js\editorOverride.js" />
<Content Include="js\jquery.ckeditor.adapter.js" />
<Content Include="js\jquery.notification.js" />
<Content Include="js\jquery.ui.controls.js" />
Expand Down
2 changes: 2 additions & 0 deletions Web/EditorControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,8 @@ private void RegisterCKEditorLibrary()
Globals.ResolveUrl("~/Providers/HtmlEditorProviders/DNNConnect.CKE/ckfinder/ckfinder.js"));
}

ClientResourceManager.RegisterScript(Page, Globals.ResolveUrl("~/Providers/HtmlEditorProviders/DNNConnect.CKE/js/editorOverride.js"));

// Load Custom JS File
if (!string.IsNullOrEmpty(currentSettings.CustomJsFile)
&& !cs.IsClientScriptIncludeRegistered(csType, "CKCustomJSFile"))
Expand Down
19 changes: 19 additions & 0 deletions js/editorOverride.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(function ($) {
if (CKEDITOR) {
CKEDITOR.on('dialogDefinition', function(evt) {
var dialog = evt.data;
if (dialog.name === 'image') {
// Get dialog definition.
var def = evt.data.definition;
var originOkFunc = def.onOk;

def.onOk = function () {
originOkFunc.apply(this, arguments);
var $element = $(this.imageElement);
$element.attr('title', $element.attr('alt'));
};

}
});
}
})(jQuery);

0 comments on commit d032df8

Please sign in to comment.