Created
May 13, 2015 19:31
-
-
Save beckettkev/d09a154a478c17ff232b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function ( my, $ ) { | |
//Implements the modal logic on the create article button | |
my.CreateArticleButton = function ( ) { | |
var _src = 'MyCompany.MyProject.CreateArticleButton'; | |
//if the button is pressed we load the article creation modal | |
var _dialog = function ( ) { | |
console.log ( _src + '.dialog initiating modal window' ) | |
var _options = { | |
tite : 'Create News Item', | |
url : _spPageContextInfo.siteServerRelativeUrl + '/Style Library/MyProject/Modal/createarticle.aspx?IsDlg=1', | |
allowMaximize : false, | |
dialogReturnValueCallback : _close | |
}; | |
SP.SOD.execute ( 'sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', _options ); | |
console.log ( _src + '.dialog loading modal window' ); | |
}; | |
var _close = function ( ) { | |
console.log ( _src + '.close modal window' ); | |
}; | |
( function ( ) { | |
//auto execute code for click event | |
console.log ( _src + ' initiating modal script' ); | |
_dialog ( ); | |
})( ); | |
}; | |
//DO OTHER STUFF… | |
} ) ( MyCompany.MyProject = MyCompany.MyProject || { }, jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment