Skip to content

Commit

Permalink
Slides
Browse files Browse the repository at this point in the history
  • Loading branch information
coillarach committed Oct 13, 2024
1 parent 2efda45 commit 88c6acf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
26 changes: 8 additions & 18 deletions _includes/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,17 @@

function prepareFigure(element) {
var extractedImage = extractChildByType(element, "img");
var imageWidth = extractedImage.style.width;
var imageHeight = extractedImage.style.height;
var imageWidth = extractedImage.width;
var imageHeight = extractedImage.height;
if((imageWidth / window.innerWidth) > (imageHeight / (window.innerHeight * 0.8))) {
slideContent.style.height = imageWidth / window.innerHeight * 0.8;
extractedImage.classList.add("slide-img-high");
}
else {
slideContent.style.width = window.innerWidth;
extractedImage.classList.add("slide-img-wide");
}
return extractChildByType(element, "img").outerHTML;
}

function fitImg(element) {
var imageWidth = element.style.width;
var imageHeight = element.style.height;
if((imageWidth / window.innerWidth) > (imageHeight / (window.innerHeight * 0.8))) {
element.style.height = imageWidth / window.innerHeight * 0.8;
}
else {
element.style.width = window.innerWidth;
slideContent.style.height = window.innerHeight * 0.8;
extractedImage.classList.add("slide-img-high");
}
return element;
return extractedImage.outerHTML;
}

function CreateSlideContent(element, tagName) {
Expand Down Expand Up @@ -170,6 +158,7 @@
};
}


var elements = document.getElementsByClassName('slide');
for(var i = 0; i < elements.length; i++) {
var el = elements[i];
Expand All @@ -180,4 +169,5 @@
for(var i = 0; i < elements.length; i++) {
var el = elements[i];
el.onclick = enableSlide;
}})();
}
})();
2 changes: 1 addition & 1 deletion tutorials/csharp/mvvm/mvvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The model-view-viewmodel (MVVM) pattern helps cleanly separate an app's business

There are three core components in the MVVM pattern: the model, the view, and the viewmodel. Each serves a distinct purpose. The following diagram shows the relationships between the three components.

![Fig. 1. The MVVM pattern](images/mvvm-pattern.png){: standalone #fig1 data-title="AAA"}
![Fig. 1. The MVVM pattern](images/mvvm-pattern.png){: standalone #fig1 data-title="The MVVM pattern"}

In addition to understanding the responsibilities of each component, it's also important to understand how they interact. At a high level, the view "knows about" the viewmodel, and the viewmodel "knows about" the model, but the model is unaware of the viewmodel, and the viewmodel is unaware of the view. Therefore, the viewmodel isolates the view from the model, and allows the model to evolve independently of the view.

Expand Down

0 comments on commit 88c6acf

Please sign in to comment.