Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
Fix external links -- open in system browser
Browse files Browse the repository at this point in the history
Conflicts:
	app/sleek.js
  • Loading branch information
Clément Vollet committed Feb 28, 2013
1 parent eb2a935 commit 4e9ceac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/sleek.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ function (Collection, DynamicContainer, Item, List, CardPanel, FadeInPanel, Fact
// Set the document's title to the application title
document.title = this.title;

// Open external link in another window
$('body').on('click','a', function() {
if ($(this).is('.img, .image')) return true;
url = $(this).attr("href");
if (url.indexOf('http://') > -1) {
window.open(url, "_system");
return false;
}
});

// Sets the locale and loads the corresponding dictionnary.
// It is then defined in the html templates's scope.
Expand Down Expand Up @@ -700,6 +709,12 @@ function (Collection, DynamicContainer, Item, List, CardPanel, FadeInPanel, Fact
case 'news':
var body = options.model.get('articleBody').replace(/\n|\r\n/g,'<br>');
options.model.set('articleBody',body,{silent: true});
return new ImagesLoader({
templateEl: '#template-' + itemType,
scroller: true,
imageClass: 'fadein',
imageSchema: options.model.toJSON()
});
default:
return new ImagesLoader({
templateEl: '#template-' + itemType,
Expand Down

0 comments on commit 4e9ceac

Please sign in to comment.